Email Attachment Problem |
[eluser]Synchy[/eluser]
Good evening, I'm having a problem with attaching files to an e-mail using the CI email class. The attachment is a pdf-file. The problem is that the e-mail sends perfectly including the attachment to my gmail address, but the e-mail message isn't included. For my hotmail address the problem is the opposite, the message is included but the attachment isn't, instead it places some random code in the message body. Code: --B_ATC_4d3daddb2961c This is the code placed in the hotmail e-mail, it's a lot longer but I won't bore you with even more random characters. This would be the code used for sending an e-mail, the path to the file etc is correct because as I said before my gmail address received the attachment perfectly. Code: function send_order_mail($to, $attach) { I hope someone has the solution to my problem, kind regards.
[eluser]InsiteFX[/eluser]
What does the $attach file path look like? Also you should specify the mail protocol. If it is SMTP then you need to specify those parameters also. InsiteFX
[eluser]Synchy[/eluser]
Everything is happening on my localhost (xampp), I've set my php.ini settings so it uses the SMTP server of my ISP. But when I change the protocol to 'smtp' or even 'sendmail' then it doesn't send e-mails anymore. The path in $attach should be correct because my gmail does receive the correct attachment, the path is "docs/bestelling_70.pdf".
[eluser]InsiteFX[/eluser]
The path should have a / when it is built. Code: /docs/bestelling_70.pdf Check when $attach is built that the path is like above. InsiteFX
[eluser]Synchy[/eluser]
When I put a "/" before the path it just sends empty e-mails, to my gmail as well. But which of the 3 protocols has to be used to use attachments? Because currently it's on the default, being 'mail'. And might it be that I just can't run the protocol 'smtp' or 'sendmail' on my xampp-server and that it might work when I deploy it on a proper webhost?
[eluser]InsiteFX[/eluser]
Try using the sendmail protocol and see if that will work. InsiteFX
[eluser]Synchy[/eluser]
It says my server probably isn't configured enough/correctly to use the 'sendmail' protocol. I'm using xampp on my localhost.
[eluser]InsiteFX[/eluser]
After your email send try this. Code: echo $this->email->print_debugger(); I use this tool for email on Windows 7 Pro 64-bit. Email testing tool InsiteFX
[eluser]Synchy[/eluser]
Then I'm getting the following error: Code: Exit status code: 1 Like in my first post the list of random characters at the end is a lot longer.
[eluser]InsiteFX[/eluser]
Use SMTP then if that is what works! But it looks like your are having an encoding type problem! trying changing the encoding to iso-8859-1 InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |