minus273
07-01-2006, 09:27 AM
Hi,
I am using a PHP script to send emails via a contact form on a web page. The only problem is that when viewing the emails in Outlook 2003, they arrive like this in a very unformatted way:
Content-type: text/html; charset=iso-8859-1 From:
X-NAS-Language: English
X-NAS-Bayes: #0: 6.17484E-006; #1: 0.999994
X-NAS-Classification: 0
X-NAS-MessageID: 141
X-NAS-Validation: {DFF16927-88E6-4EAA-A097-460B7E65289B}
<html> <head> <title>Contact Form</title> </head> <body> <p><strong>Reason:</strong> </p> <p><strong>Name:</strong> Paul</p> <p><strong>E-mail:</strong> sdvs@ddos.com</p> <p><strong>Comment / Question:</strong></p> <p>sdvsd</p> <p><strong>Mailing List:</strong> </p> <p><strong>Sent on:</strong> Wed, Jun 14th 2006 / 9:00pm</p> <p><strong>Logged IP Address:</strong> 86.138.68.196</p> </body></html>
Now, all of the other html emails that i recieve from other sources look as they should. The PHP code that i'm using to send these looks like so:
$time = time();
$datetime = date("D, M jS Y / g:ia", $time);
$ip = $_SERVER["REMOTE_ADDR"];
$message = '
<html>
<head>
<title>'.$subject.'</title>
</head>
<body>
<p><strong>Reason:</strong> '.$Reason.'</p>
<p><strong>Name:</strong> '.$Name.'</p>
<p><strong>E-mail:</strong> '.$Email.'</p>
<p><strong>Comment / Question:</strong></p>
<p>'.SafeHTML($Comment).'</p>
<p><strong>Mailing List:</strong> '.$Mailing.'</p>
<p><strong>Sent on:</strong> '.$datetime.'</p>
<p><strong>Logged IP Address:</strong> '.$ip.'</p>
</body></html>';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $name\r\n";
mail($to, $subject, $message, $headers);
Any ideas anyone?
Many thanks.
I am using a PHP script to send emails via a contact form on a web page. The only problem is that when viewing the emails in Outlook 2003, they arrive like this in a very unformatted way:
Content-type: text/html; charset=iso-8859-1 From:
X-NAS-Language: English
X-NAS-Bayes: #0: 6.17484E-006; #1: 0.999994
X-NAS-Classification: 0
X-NAS-MessageID: 141
X-NAS-Validation: {DFF16927-88E6-4EAA-A097-460B7E65289B}
<html> <head> <title>Contact Form</title> </head> <body> <p><strong>Reason:</strong> </p> <p><strong>Name:</strong> Paul</p> <p><strong>E-mail:</strong> sdvs@ddos.com</p> <p><strong>Comment / Question:</strong></p> <p>sdvsd</p> <p><strong>Mailing List:</strong> </p> <p><strong>Sent on:</strong> Wed, Jun 14th 2006 / 9:00pm</p> <p><strong>Logged IP Address:</strong> 86.138.68.196</p> </body></html>
Now, all of the other html emails that i recieve from other sources look as they should. The PHP code that i'm using to send these looks like so:
$time = time();
$datetime = date("D, M jS Y / g:ia", $time);
$ip = $_SERVER["REMOTE_ADDR"];
$message = '
<html>
<head>
<title>'.$subject.'</title>
</head>
<body>
<p><strong>Reason:</strong> '.$Reason.'</p>
<p><strong>Name:</strong> '.$Name.'</p>
<p><strong>E-mail:</strong> '.$Email.'</p>
<p><strong>Comment / Question:</strong></p>
<p>'.SafeHTML($Comment).'</p>
<p><strong>Mailing List:</strong> '.$Mailing.'</p>
<p><strong>Sent on:</strong> '.$datetime.'</p>
<p><strong>Logged IP Address:</strong> '.$ip.'</p>
</body></html>';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $name\r\n";
mail($to, $subject, $message, $headers);
Any ideas anyone?
Many thanks.