Hi,

This is code.

$toname = 'XXXXXXXX';
$to = 'test@mail.com';
$fromname = 'YYYYYYY';
$from = 'test123@mail.com';
$subject = 'This is test email ';
$body = 'Hai this is test email MIME......Help me out.....';

$text_body ='<html>
<head>
</head>
<body>
<table align="center" cellpadding="5" cellspacing="0">
<tr align="right">
<td bgcolor="#336699">
<b><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif">EMAIL NOTICE</font></b>
<img src="/images/logo.png" width="51" height="48" border="0" align="absmiddle" />
</td>
</tr>
<tr>
<td>'. $body.'</td>
</tr>
</table>
</body>
</html>';

//****************************************New PHP Mail Implementation*********************************
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: '.$toname.' <'.$to.'>' . "\r\n";
$headers .= 'From: '.$subject.'<'.$from.'>' . "\r\n";

// Mail it
mail($to, $subject, $text_body, $headers);

------------------------------------------------
In the above code is working some of the client emails. Outlooks and some others is working fine. But Some client email does not working. The email will show exactly HTML code format. So user can not view and read and everything HTML and Table code format.

How can we rectify this problem. I want work all the client email with exactly what we sent. It does not show the html and div and css code. please give me any solutions asap.

thanks
William

You cannot always force it. My email settings are set specifically to plain text. You could try to use a mailing tool (PHPMailer for example). Most of them have a lot more settings then the default mail() function. All of those specific headers are already built for you, so you have less hassle to deal with. (Next time please use code tags.)

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.