Wrong attachment name when sending with Email class - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Wrong attachment name when sending with Email class (/showthread.php?tid=23463) |
Wrong attachment name when sending with Email class - El Forum - 10-12-2009 [eluser]mDonchev[/eluser] Hi Guys, I have a problem sending email with attachments. When I make this in the controler: Code: $this->email->attach($_FILES["doc1"]["tmp_name"],$_FILES["doc1"]["name"]); I get the email, and there is an attachment, but instead of the real filename, the attachment is displayed with the tmp_name of the attached file. Can you give me a hand and tell me what I do wrong to get the real filename as a name of the attachment? Thanks in advance Martin Wrong attachment name when sending with Email class - El Forum - 10-12-2009 [eluser]rogierb[/eluser] The second parameter is not for a name, but for the disposition. If you want to use a different filename,you have to extend the email class like this: Code: function attach($file, $filename, $disposition = 'attachment') and in the _built_message: Code: $filename = $this->_attach_file[$i]; That should do the trick. |