I am trying to embed company logo (image) in an html email which i am sending using PHP mail function. I tried the following way but didnt work. So, I am not sure how to go about. Please see my code below and advice me.
Code:
<?php
$to = "someone@somedomain.com";
$subject = "Test Mail";
$body = "<html><br>";
$body .= "<head><title>Test Mail</title></head>";
$body .= "<body>";
$body .= "<img src=\"http://www.mydomain.com/images/logo.jpg\" width=\"100%\">";
$body .= "</body>";
$body .= "</html>";
$headers .= "From: Me<myself@mydomain.com\r\n";
$headers .= "Reply-To: Me<myself@mydomain.com\r\n";
$headers .= "Return-Path: Me<myself@mydomain.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/alternative; charset=ISO-8859-1\r\n";
$sent = @mail($to, $subject, $body, $headers,"-f [email]myself@mydomain.com[/email]");
if($sent){
echo "Successful!"
}
else{
echo "Un-successful!"
}
?>
Comment