I am facing a very strange issue... The issue is:
On click of Submit button of the HTML Form, on the server side I am storing all values in to memory variables and dispatching an Email.
The email is correctly dispatched.
Email content is properly rendered in an Gmail Account. But when viewing the email contents in Microsoft Outlook, foreign characters are added to certain fields in the Email.
Here is the PHP code for Email I am using:
- Code: Select all
<?php
$to ='test@open-source-varsity.com';
$subject = "Testing";
$message = '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>' . $subject . '</title></head>
<body style="font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; font-size: 10pt;">
<fieldset style="width:700px;">
<legend> <strong>Personal Information</strong> </legend>
<table width="100%" cellspacing="0" border="1" cellpadding="5" align="left">
<tr>
<td align="right" style="font-size: 10pt;" width="30%"><strong>Title:</strong></td>
<td align="left" style="font-size: 10pt;" width="70%">'.$m_title.' </td>
</tr>
<tr>
<td align="right" style="font-size: 10pt;" width="30%"><strong>First Name:</strong></td>
<td align="left" style="font-size: 10pt;" width="70%">'.$m_fname.' </td>
</tr>
<tr>
<td align="right" style="font-size: 10pt;" width="30%"><strong>Middle Name:</strong></td>
<td align="left" style="font-size: 10pt;" width="70%">'.$m_mname.' </td>
</tr>
<tr>
<td align="right" style="font-size: 10pt;" width="30%"><strong>Last Name:</strong></td>
<td align="left" style="font-size: 10pt;" width="70%">'.$m_lname.' </td>
</tr>
<tr>
<td align="right" style="font-size: 10pt;" width="30%"><strong>Address:</strong></td>
<td align="left" style="font-size: 10pt;" width="70%">'.$m_address.' </td>
</tr>
<tr>
<td align="right" style="font-size: 10pt;" width="30%"><strong>Email Address:</strong></td>
<td align="left" style="font-size: 10pt;" width="70%">'.$m_email_id.' </td>
</tr>
<tr>
<td align="right" style="font-size: 10pt;" width="30%"><strong>Confirm Email Address:</strong></td>
<td align="left" style="font-size: 10pt;" width="70%">'.$m_confirm_email_id.' </td>
</tr>
</table>
</fieldset>
<div class="divClr" style="clear:both;"> </div>
</body>
</html>';
/* To send HTML mail, set the Content-type header. */
$headers = "MIME-Version: 1.0 \n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \n";
/* additional headers */
$headers .= "To: " . $to ." \n";
/* and now mail it */
if(mail($to, $subject, $message, $headers))
{
$status = "Sent";
}
?>
Output of the above in Outlook as shown in diagram below:
This has never happen before. Please can some one help me.
Thanks a lot.
Regards,
Meher K Bala
http://www.open-source-varsity.com

