Found the solution in php.net
Derek
08-Feb-2004 07:03
I had the problem that when sending "large" emails (at least 1000 characters), the mail function would add exclamation characters "!" into the body of the email.
This was easily fixed by adding a wordwrap to the body of the email. The following function will do this for you:
<?php
function send_mail($myname, $myemail, $contactname, $contactemail, $subject, $message, $bcc) {
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: \"".$myname."\" <".$myemail.">\n";
if ($bcc != "")
$headers .= "Bcc: ".$bcc."\n";
$output = $message; $output = wordwrap($output, 72);
return(mail("\"".$contactname."\" <".$contactemail.">", $subject, $output, $headers));
}
?>
Instead of use his function, I simple wordwrap the message before I mail the message
$message=wordwrap($message, 72);
Could any one tell me, why this will fix the problem?
My code was working fine with the long message before, suddently it has the "!" shows randomly. Now after I wordwrap the message, the "!" problem solved.
Could that because my ISP firewall set up changes and break the e-mail to smaller pieces than before and that cause me the problem?
I have other scripts use the mail() to send the large message, I didn't see these scripts have problems to show "!" randomly.
My next question is should I wordwrap all my mail() out messages anyway?
Thanks!