Take the 2-minute tour ×

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: <

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:


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... :/

share|improve this question
As a note, this happens when a line of HTML is considered too long for the email and the mail server breaks the line anywhere. –  Alexis Wilke Dec 6 '13 at 8:01

2 Answers 2

up vote 3 down vote accepted

Simple workaround

$body = str_replace("<","\r\n<", $body);

Every HTML tag will start from new line giving you:


And this:

<table width=3D"100%" cellspacin=

Is not valid HTML. (what is 3D?) so that could be reason why Outlook is wrapping it

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?)

share|improve this answer
Woaaa you made my day :)) You're simple workaround is working like a charm -> immediately i have no broken mails anymore ind Outlook and GMail... Just another thing i'm wondering... Do you have an idea why Outlook is deleting my "background: url(an-image-url.jpg)" inline-style-definition on a table-layout's TD element? Any other tested client is rendering perfectly my background-image-styling, but not outlook... –  jebbie Aug 31 '12 at 14:07
what about this –  Peter Aug 31 '12 at 14:28
Note that the =3D in an encoded email represents the character '=' (3D is the ASCII code in hex.) –  Alexis Wilke Dec 6 '13 at 7:59

<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. :)

share|improve this answer
thanks for your info anyway ;) i did not have the idea that it could be a kind of encoding –  jebbie Sep 18 '12 at 17:09

Your Answer


