I have the following code that is very simple and gets information from form fields and mails it off. The issue is that when the email is received using Microsoft Outlook 2003 the message is blank and the actual message that is supposed to be there is an attached HTML file. This, as you can imagine, would be tedious to open every time a message is received.
<?php
$recipient = "name@email.com";
$subject = "Message from ".$_REQUEST['YourName'];
$headers="From: ".$_REQUEST['YourEmail']."\n";
$headers.="Content-type: text/html; charset=iso-8859-1";
$message = "<p>A ".$_REQUEST['EnquiryType']." from ".$_REQUEST['YourName']." has been received</p>
<b>The message is as follows: </b><p>".$_REQUEST['YourMessage']."</p>
<p><b>Sender Details</b><br/>Email: ".$_REQUEST['YourEmail']."<br/>Tel: ".$_REQUEST['YourPhone']."</p>
";
if(mail($recipient, $subject, $message, $headers))
{
header("Location: http://www.blank.co.uk/thanks.html");
}
else
{
echo "There was an error sending your message. Please contact us via telephone.";
}
?>
So I'm not sure if there is something wrong with my PHP code or my Outlook setup. Granted I am receiving other HTML messages without it being an attachment.
Any input would be appreciated!