Welcome Guest, Not a member yet? Register   Sign In
Email attachment problem
#1

[eluser]cboyd[/eluser]
I am successfully sending emails using the Email Class, but the attachments are not working. I have verified that the path to the file is valid and that the file exists. The email Send command is not generating any errors, but the attachment (a pdf) are not being attached.

Anyone have any ideas?
#2

[eluser]ivantcholakov[/eluser]
More information is needed...

Please, post you fragment of code that creates and sends email. Tell what version of CodeIgniter do you use.
#3

[eluser]cboyd[/eluser]
I am using the latest PyroCMS (v2.2.1) which is built on CodeIgniter (not sure what version)

My code is:

$this->ci->email->from($from, $from_name);
$this->ci->email->reply_to($reply_to);
$this->ci->email->to($to);
$this->ci->email->subject($subject);
$this->ci->email->message($body);

// To send attachments simply pass an array of file paths in Events::trigger('email')

if (isset($data['attach']))
{
foreach ($data['attach'] AS $attachment)
{
$this->ci->email->attach($attachment);
}
}

return (bool) $this->ci->email->send();

I have checked all of the variables being passed and they all contain valid data including the file path.
#4

[eluser]ivantcholakov[/eluser]
I can see that PyroCMS uses CI3.0-dev since some time ago. If your data is really correct, here is a quick first attempt that I can propose:

Find system/codeigniter/libraries/Email.php. Rename it as system/codeigniter/libraries/Email_old.php.
Download current source file of the email library https://github.com/EllisLab/CodeIgniter/.../Email.php (click the button "Raw").
Place it as system/codeigniter/libraries/Email.php.

See what would happen.
#5

[eluser]CroNiX[/eluser]
It's probably a better question for PyroCMS to answer, since it's their product and they have a lot of customization.




Theme © iAndrew 2016 - Forum software by © MyBB