Email attachment not working - 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: Email attachment not working (/showthread.php?tid=18205) |
Email attachment not working - El Forum - 04-28-2009 [eluser]Computerzworld[/eluser] I am using CI Email library for sending emails. But attachment is not working for me. I have tried to attach files using $this->email->attach() function. But it didn't worked. Here is my function for sending email. Code: function send() Unable to open this attachment: uploads/files/1.jpg . I have tried with various paths like $_SERVER['DOCUMENT_ROOT'].'uploads/files/1.jpg' , './uploads/files/1.jpg' etc. But no one works for me. Even I have checked for permissions for upload folder. Its already set to rwx for all users. But still attachment doesn't works. Also when I try to send the mail with attachment mail body doesn't comes. As soon as I comment this line,the message body comes. I don't know what is the problem behind this. Please help me. Thanks in advance. Email attachment not working - El Forum - 04-29-2009 [eluser]Zeeshan Rasool[/eluser] Did you check like that?use '.' before upload/files Code: $path = ".uploads/files/1.jpg"; Email attachment not working - El Forum - 04-29-2009 [eluser]Thorpe Obazee[/eluser] In case you upload the file before you send it, you can use the file upload, $this->upload->data() array. Email attachment not working - El Forum - 04-29-2009 [eluser]Computerzworld[/eluser] Yes. I have checked with .uploads too but it didn't work. Also I have that file already available on server so it doesn't need to be uploaded... |