siwelis Posted June 18, 2010 Share Posted June 18, 2010 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 More sharing options...
cyberRobot Posted June 18, 2010 Share Posted June 18, 2010 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. Link to comment https://forums.phpfreaks.com/topic/205152-spaces-dissapearing-in-email-why/#findComment-1073895 Share on other sites More sharing options...
siwelis Posted June 18, 2010 Author Share Posted June 18, 2010 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. Link to comment https://forums.phpfreaks.com/topic/205152-spaces-dissapearing-in-email-why/#findComment-1074069 Share on other sites More sharing options...
siwelis Posted June 18, 2010 Author Share Posted June 18, 2010 Has anyone heard of this? When I echo "<table border"... it comes out fine When I put it through mail( it removes the space to be "<tableborder" thus showing up incorrect Link to comment https://forums.phpfreaks.com/topic/205152-spaces-dissapearing-in-email-why/#findComment-1074166 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.