HTML emails sent as plain text |
[eluser]Billy Khan[/eluser]
I am trying to send a html email, the problem is that in google mail, the email displays the html rather than rendering it. I have mailtype set to html. this is what the debugger prints: Your message has been successfully sent using the following protocol: mail Code: User-Agent: CodeIgniter and my email displays Code: <html> Any ideas?
[eluser]bretticus[/eluser]
Looks like you have alternative message set: Code: $this->email->set_alt_message('This is the alternative message'); Remove that line. Gmail is showing the plain text part for you. Not sure it that's the default or what, but that appears to be your problem. EDIT: Ah, sorry. I see now that the HTML part is showing as plain text. That's strange considering the mime type clearly shows text/html. Hmmm...
[eluser]BrianDHall[/eluser]
I can't tell that anything is wrong with that from what you posted. If nothing else you might try CodeIgniter's Email Class which supports sending mail as HTML. Might try a hello world example with that and see if you get the same problem - if not maybe you can go backwards from there to see what is different...or just pretend it never happened and use the CI class If that doesn't work I would think perhaps a problem with the sendmail setup, maybe having a default to text somewhere - but odd that the MIME seems right. Does this do this if you access it from other email clients, or just google?
[eluser]mattthehoople[/eluser]
Is it just in gmail that it fails to render? It may be your server set up... It does say... "Content-Type: multipart/alternative; boundary="B_ALT_4aa910422ad94" This is a multi-part message in MIME format. Your email application may not support this format." Perhaps your email application doesn't support this format?
[eluser]Billy Khan[/eluser]
Managed to sort it. An CI upgrade. Cant see in the change notes what was done to fix it. Needless to say, all is well. Thanks for your help.
[eluser]bretticus[/eluser]
I saw something on a google mail help forum somewhere today about the boundary line needing to be indented for a multipart. No idea really, but that's a possibility I suppose. |
Welcome Guest, Not a member yet? Register Sign In |