Page 1 of 1

problems sending HTML mails

Posted: Sun Oct 19, 2003 7:34 am
by mzfp2
Hi

Ive used the following code from another post to send HTML emails

Code: Select all

<?php 
$message = "<h1>Hello world!<h1>"; 
$to      = "empfaenger@system.de"; 
$subject = "Betrefftext"; 
$xtra    = "From: ab@sender.de (Ab Sender)\r\n"; 
$xtra   .= "Content-Type: text/html\r\nContent-Transfer-Encoding: 8bit\r\n"; 
$xtra   .= "X-Mailer: PHP ". phpversion(); 

mail($to, 
     $subject, 
     $message, 
     $xtra); 

?>

It works perfectly fine, except when i receive the email myself, the HTML output contains the following line at the top of the email

Content-Transfer-Encoding: 8bit X-Mailer: PHP 4.1.2

how do I get rid of it?!

Posted: Sun Oct 19, 2003 8:40 am
by markl999
Er..just don't add it to the email? i.e

Code: Select all

$xtra    = "From: ab@sender.de (Ab Sender)\r\n";
$xtra    .= "Content-Type: text/html\r\n";
//$xtra   .= "Content-Transfer-Encoding: 8bit\r\n"; 
//$xtra   .= "X-Mailer: PHP ". phpversion();
??

Posted: Sun Oct 19, 2003 1:17 pm
by mzfp2
yeah i shouldve tried that, but i thought its probably important part of the header or something :oops: