note 39730 deleted from function.mail by aidan

From: Date: Mon, 14 Feb 2005 02:10:41 +0000
Subject: note 39730 deleted from function.mail by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-84960@lists.php.net to get a copy of this message
Note Submitter: Derek ---- 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)); } ?>

« previous php.notes (#84960) next »