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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot send out html format email

Status
Not open for further replies.

keak

Programmer
Sep 12, 2005
247
CA
Hi there I have the following code:

Code:
   // send email to notify non-existing link
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= "From: mail title <blah@domain.com>";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $subject= "email subject";
    $message="blah"

    mail("toemail@domain.com", $subject, $message, $headers);


and the email I am getting is in text format;

Am I missing something here? My mail agent is POSTFIX.


Thanks!
 
your message does not include any html!

what happens if you change $message
Code:
$message = "<div style=\"color:red\">Hello</div>";
 
oh no, i was saying that even if I put in html tags it shows as plain mail in my gmail and outlook clients.

I have triple checked my headers variable and am not sure where this is happening ...

 
could be that some mail clients are simply stripping the html.

try sending the mail with phpmailer (from sourceforge), using the isHTML() option. If that fails then it's the mail client causing the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top