Welcome Guest, Not a member yet? Register   Sign In
How to attached pdf file in mail ?
#1

[eluser]cpp643[/eluser]
Dear All ,
I want to attached pdf file while sending mails, i have used CI 's mail attachment function but it isn't working. and i am generating pdf file on fly and i am not store it on server... so is it possible to attach to mail without saving it to on server????
#2

[eluser]umefarooq[/eluser]
hi you can do one thing store the file on the server when mail is sent successfully than you can unlink the file. so there will be no more file on the server

Code:
unlink('path/file.pdf');
#3

[eluser]cpp643[/eluser]
but i don't want to do it, i already know this is the last solution for me....
#4

[eluser]TheFuzzy0ne[/eluser]
That's a very strange requirement. Why is it so important that you don't write the file to disk, even if it is going to be unlinked immediately afterwards?
#5

[eluser]pistolPete[/eluser]
You can achieve this by extending the CI_Email class, I attached a sample class.
Put this file into ./system/application/libraries/.
I didn't test it, so please report back if it's working.

Using this extension you can attach a "virtual file":
Code:
// generate PDF
$file_contents = ... ;
$this->email->attach('filename.pdf', 'attachment', $file_contents );
#6

[eluser]monkeycymbal[/eluser]
hi!
I was looking for this kind of solution, I would to try it, but will be there a problem with downloading from the forum.
Can you upload your class (maybe in mediafire, or gdocs) again?
thank you so much!




Theme © iAndrew 2016 - Forum software by © MyBB