Hi,
I have a problem in sending mail in HTML format using PHP mail() function. The problem is that the HTML is not rendered in microsoft outlook (showing raw data) but in yahoo it is good and the HTML is rendered and shown correctly. These are the mail agent I have checked the mail so far. I have used the following code which is basically taken from PHP manual.

<?php
$to  = 'xyz@example.com'; 

$subject = 'some subject';

$message = 'some HTML code such as a big table';

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: sender <pqr@example.com>' . "\r\n";

mail($to, $subject, $message, $headers);
?>

Can any one say where the problem is and can provide a solution such that is works in all mail agent.

Thanks.

Recommended Answers

All 2 Replies

sayaan, Please start a new thread.

@buddylee17 - post moved to new thread

@sayaan - Do not piggyback threads (aka "hijack" threads) by posting your question as a reply to another question.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.