Cannot attach to email |
[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.
[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.
[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 |
Welcome Guest, Not a member yet? Register Sign In |