Jump to content

Spaces Dissapearing in Email - Why?


siwelis

Recommended Posts

When I echo $var it works great, however when I mail the $var, it removes some spaces...

 

Content-Type: text/html; charset="windows-1256"
Content-Transfer-Encoding: quoted-printable
<center><tableborder="0"cellpadding="3"cellspacing="3"style="border-collapse: collapse" bordercolor="#111111" 

 

It seems to randomly remove the spaces...

 

No space after table so it doesn't show up right in email...

 

I do this just before inserting the data...

$tabledata = nl2br($tabledata);
mail($to, $subject, $tabledata, $headers);

 

Anyone have any idea why spaces are dissapearing?

 

Also, I tried without nl2br too... I just can't figure out where the spaces are leaving.

Link to comment
https://forums.phpfreaks.com/topic/205152-spaces-dissapearing-in-email-why/
Share on other sites

When you say that spaces are disappearing, it sounds like you're talking about the space between lines of text. It also sounds like the spaces are disappearing when you view the e-mail message in your e-mail client (Outlook, Gmail, Hotmail, etc.)

 

If this is the case, are you using Outlook to view the e-mail? If so, is there something at the top of the message which says "Extra line breaks in this message were removed"? In Outlook 2007, the message is highlighted in blue and appears above the date the e-mail was sent. If you see that message, just click it and click "Restore line breaks". Of course this will only temporarily fix the e-mail message on your computer.

It's the actual white spaces between words, unfortunately. It does seem to remove linebreaks too though, but with BR tags therein, I think the line breaks should still show up on the user end.

 

I tried to view it from a webmail service (which shows up completely blank) and from thunderbird, which renders the last quarter of the table or so.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.