Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set content type to html

Status
Not open for further replies.

gameon

Programmer
Feb 23, 2001
325
GB
Hi I am using the following to send out some mail (thanks matto),

but the content type is not sent to html. Does anyone know how to?

M@

<?php

$addresses = file(&quot;addresses.txt&quot;);
// addresses is now an array, 1 line per element.

foreach($addresses as $address)
mail($address,&quot;subject&quot;,&quot;content&quot;);


?>

 
Now I'm trying to use this:


<?php

$addresses = file(&quot;addresses.txt&quot;);
// addresses is now an array, 1 line per element.

foreach($addresses as $address)

$subject1 = &quot;subject&quot;;
$mailheaders = &quot;From: me@me.com\n&quot;;
$mailheaders .= &quot;Reply-To: matt.me.com\r\n&quot;;
$mailheaders .= &quot;Content-Type: text/html\r\n&quot;;

$msg1 = &quot;<html></html>&quot;;
mail($address, $subject1, $msg1, $mailheaders) or die (&quot;Couldn't send mail&quot;);
header(&quot;Location: emailed.htm&quot;);
?>


Still not working though...

M@
 
I think you need to replace your content-type line with this:
Code:
$mailheaders .= &quot;Content-Type: text/html\r\n\r\n&quot;;

You need to have 2 lines after you declare the content-type
-gerrygerry
misanthropist01@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top