I am working on an HTML page where i need to send confirmation by HTML email using PHP. I don't have much experience in PHP as i occasionally work on PHP.
I am able to send the HTML email using PHP and it comes up nice except the IMAGE part.
I have checked about 30 example and implement different ways of but non works.
When i check the source code of email it shows image part as
<img src="http://www.xyz.com/images/emailheader.jpg\"">
<img src="http://www.xyz.com/images/emailheader.jpg\";" alt="mage"">
Code for HTML
$subject = 'Confirmation';
$message = '<table ><tr><td><img src=\"http://www.xyz.com/images/emailheader.jpg\" /></td></tr><tr><td >'. "\r\n";
$message .= '<img src=\"http://www.xyz.com/images/emailheader.jpg\"; alt="Image" />';
$message .= 'Title <br/><br/>'. "\r\n";
$message .= 'Dear '. $_SESSION['FN'] . ' '.$_SESSION['LN'].'<br/><br/>'. "\r\n";
$message .= ' <br/><br/>'. "\r\n";
$message .= 'Name: '. $_SESSION['FN'] . ' '.$_SESSION['LN'].'<br/>'. "\r\n";
$message .= 'Email: '. $_SESSION['Email'].'<br/>'. "\r\n";
$message .= '<br/><br/>.'. "\r\n";
$message .= '<br/><br/>Best Regards,'. "\r\n";
$message .= '</td></tr></table>';
//Headers
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$headers .= 'Content-Transfer-Encoding: quoted-printable' . "\r\n";
$headers .= 'From: booking@xyz.com' . "\r\n";
$headers .= 'Reply-To: abc@xyz.com' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
ini_set ( "SMTP", "smtp.abc.com" );
I would appreciate if some can correct my code or at-least tell me what i am doing wrong
problem is in this line:
'<img src=\"http://www.alfarooqcentre.com/images/emailheader.jpg\"; alt="Image" />';
remove "\\" and ";"
or check this tutorial, there is what you want.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.