I'm digging deep in html-email stuff and finally, i have still an unsolved problem with annoying line-breaks :/
GMail and or Outlook are often breaking the line exactly during a tag - resulting in a completely broken look & feel.. so it can happen that the whole content is in a < h2 > because the ending-tag is broken through a line-break..
m</strong><br/>Passwort: <
strong>20o3a7
That's an example of a broken e-mail generated by my PHPMailer code..
Now i was fascinated with an email of a company, perfectly styled newsletter.. There i saw a code like this:
<table width=3D"100%" cellspacin=
g=3D"0" border=3D"0" cellpadding=3D"0">
This i can see on almost any line of this strange e-mail -> always ending with "=" on any line, altough if it is in the middle of a tag or a parameter-word.. and it is perfectly working! How that? It seems to me that this line-breaks are generated before it comes to the e-mail client, but this is only speculation of me...
I can find extermely nice articles how to create a correct HTML-Email like this:
http://24ways.org/2009/rock-solid-html-emails
But nobody writes something about this annoying line-break problem, but i can't believe that i'm the only one that has this issue... :/
<table width=3D"100%" cellspacing=3D"0" border=3D"0" cellpadding=
It's called quoted printable encoding which is common for html emails. '=3D' for instance stands for '='.
Regarding to your problem: never occured to me. It's be difficult to debug without beeing able to look at the source. But it seems you got a solution anyway. :)
Simple workaround
$body = str_replace("<","\r\n<", $body);
Every HTML tag will start from new line giving you:
m
</strong>
<br/>Passwort:
<strong>20o3a7
Another thing is, i used PHPMailer
in many projects, sending thousands e-mails to all mail clients, and i never experienced that issue. Make sure your code is OK. (maybe your text editor is wrapping that lines?)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With