Monday, July 9, 2007

exclamation mark (!) showing up in emails from PHP mail() function

I ran into this problem and this is the solution that worked for me. This post helped out http://us2.php.net/manual/en/ref.mail.php#53231


It references RFC 2822, and look at section 2.1.1. "Line Length Limits" for the explanation of the 998 char limit. Anyway the solution at php.net worked for me minus the rtrim.

The php code for mine is

$message = chunk_split(base64_encode($message));

Then also you must make sure the headers are using base64 for the Content-Transfer-Encoding:
$header .= "Content-Transfer-Encoding: base64\r\n\r\n";

<the todd />

9 comments:

jose said...

thanks, it was very helpfull!

Unknown said...

Yes...very helpfull!

Shelby said...

Hallelujah! Thank you soooooooooooo much! I'm surprised this info isn't shared more for us rookies.

jitendra said...

http://www.jeremytunnell.com/posts/really-hairy-problem-with-seemingly-random-crlf-and-spaces-inserted-in-emails

Zahir said...

Thanks buddy,

its helped me to fixed my problem

El Ranger said...
This comment has been removed by the author.
El Ranger said...

Thanks Bro, you offer a very simple solution to a wear a complex problem.

thanks.

Nathan Fox said...

Thank you, very helpful!

Anonymous said...

Finally, a straight forward and clear answer to a pain in the neck issue. Thanks!