Web Hosting Talk







View Full Version : Sending an html header to the mail() function


rami90_999
09-15-2002, 01:32 PM
$header = "From: \"".addslashes($sender_name)."\" <".$sender_email.">\r\n";
$header .= "Reply-To: ".$sender_email."\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$header .= "X-Priority: 1\r\n";
$header .= "X-Mailer: PHP / ".phpversion()."\r\n";
$header .= "Cc: ".$other_email."\r\n";
$header .= "Bcc: ".$another_email."\r\n";

ok.. so now i add put $header into mail() but.. where do i put the content? and is it possible to add variables to the html content? go in and out of php adding the vars and going out again.. is that possible? or is there a way around it through javascript?

-Rami

The Prohacker
09-15-2002, 01:42 PM
mail($to, $subject, $message, $header);

This what you want?

rami90_999
09-15-2002, 01:51 PM
no.. uve put the header variable in the mail() with all the others.. we dont need that.. $header is enough for all of them.. what im asking is where can i put the content in the header variable? or do i have to add another permiter/? and can i add variables to the html email? like go in and out of php?