View Single Post
  #8 (permalink)  
Old 12-12-03, 08:12 AM
whiteraider whiteraider is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

/*basic mail settings */

$Msg="some HTML message";
$subject  "some subject";
$headers  "MIME-Version: 1.0;\n";
$headers .= "Content-type: text/html; charset=iso-8859-1;\n";

/* additional headers */
//$headers .= "To: webmaster <webmaster@somedomain.com>;\n";
$headers .= "From: Errors <errors@somedomain.com>;\n";
$headers .= "Cc: [email]admin@somedomain.com[/email];\n";
$headers .= "Bcc: [email]another.boss@somedomain.com[/email];\n";

/* and now mail it */
mail($to$subject$Msg$headers); 
This is the code that I use to mail a html table from one of my sites

The $headers TO field is commented out because the server uses QMail which has a bug that sends a copy of the mail for any TO field, so 2 copies get sent not 1.

Also note that there is a ; (semi-colon) at the end of each header, this also is needed otherwise the message gets sent as text. - This had me stumped for a while as my test server didn't need them!
Reply With Quote