Can anyone please help me with the following email code. All I am trying to do is get an image to show in the body of the email when the person receives it. How would I need to change the following code to get this to work. All that happens just now is that the image html shows as code!
// Send an email
function sendEmail($to, $subject, $message){
// To send HTML mail, the Content-type header must be set
$headers .= 'MIME-Version: 1.0' . "\\r\
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\\r\
";
$headers .= 'From: Me <me@mysite.co.uk>' . "\\r\
";
// Mail it
mail($to, $subject, $message, $headers);
}
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
//Send Email Request
$headers = "MIME-Version: 1.0\\r\
";
$headers .= "From:$Email\\r\
" .
"Errors-To: me@mysite.co.uk" . "\\r\
" .
"X-Mailer: PHP/" . phpversion();
$message = "Please find below your Voucher.\\r\
\\r\
";
$message .= "<img src='http://www.mysite.co.uk/voucher.gif'>\\r\
\\r\
";
mail("$email","RE: voucher","$message", "From:me@mysite.co.uk");
Any help greatly appreciated.
Thanks in advance.