PHP And HTML Emails And Exclamation Marks

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

PHP And HTML Emails And Exclamation Marks

Post by microthick »

Problem: I have a script that creates a rather lengthy html email and sends it.

It had a problem in that the person who received the email would see ! marks littering the email, sometimes looking like misspelled words and other times within the html itself so that the "look" of the email was changed.

It would look like:

<span style="font-family: Aria! l, sans-serif;">Something</span>


Cause: This was caused by having NO line breaks within my $mailbody. Apparently, without line breaks, the mail server will just inject ! and a space whenever the max characters without a line break had been reached. This would be somewhere around 200 characters, or so.

Resolution: By adding \n at regular intervals in the html email, the problem was fixed.

I believe the php function wordwrap() can also be used to fix this problem.
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Yeah, I think the max line length for emails is around 75 characters long... or there abouts.
Post Reply