![]() |
Cannot attach to email - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Cannot attach to email (/showthread.php?tid=31817) |
Cannot attach to email - El Forum - 07-02-2010 [eluser]Wario[/eluser] I searched the forum for an answer and couldn't find one, so I apologize if this has already been solved. I've been following this tutorial for CI: net.tutsplus.com, and I cannot get the email class to attach a simple file to the sent email. It appears in my inbox ok but with no attachment. Am I missing something in the config? I'm not sure why it's not working unless there is something else I need to set up in my php.ini file. I'm still a beginner in PHP so I could have overlooked something. Code: <?php I created a new config file for email in put it in my application/config folder: Code: <?php if( ! defined('BASEPATH')) exit('No direct script access allowed'); Thanks for your help. Cannot attach to email - El Forum - 07-02-2010 [eluser]Wario[/eluser] Outside of the system directory there is another folder called attachments, and in that directory there is a sample file call yourInfo.txt. The file_exists() test works, but for some reason that I can seem to get it will not attach the file in the email. Cannot attach to email - El Forum - 07-28-2010 [eluser]Unknown[/eluser] Try to put a trailing slash $file = FCPATH . 'attachments/yourInfo.txt'; instead $file = FCPATH . '/attachments/yourInfo.txt'; hope this will help you |