I have CodeIgniter script for sending email with attachments.
$this->ci->email->attach("/path/to/file/myjhxvbXhjdSycv1y.pdf");
It works great, but I have no idea, how rename attached file to some more user-friendly string?
I have CodeIgniter script for sending email with attachments.
$this->ci->email->attach("/path/to/file/myjhxvbXhjdSycv1y.pdf");
It works great, but I have no idea, how rename attached file to some more user-friendly string?
CodeIgniter v3.x
This feature has been added since CI v3:
According to the user guide:
CodeIgniter v2.x
However for CodeIgniter v2.x, you can extend the
Email
library to implement that:system/libraries/Email.php
and put it insideapplication/libraries/
MY_
prefix (or whatever you have set inconfig.php
)application/libraries/MY_Email.php
First: Insert this at line #72:
Second: Change the code at line #161-166 to:
Third: Find the
attach()
function at line #409 and change it to:Fourth: Finally at line #1143 change the code to:
Usage