Email attachment not working |
[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.
[eluser]Zeeshan Rasool[/eluser]
Did you check like that?use '.' before upload/files Code: $path = ".uploads/files/1.jpg";
[eluser]Thorpe Obazee[/eluser]
In case you upload the file before you send it, you can use the file upload, $this->upload->data() array.
[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... |
Welcome Guest, Not a member yet? Register Sign In |