|
|
Send Embedded Image to mail - PHP
|
Views : 471
|
|
Tagged in : PHP
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
Normally the image not shown in mail, instead of this we have to click 'show image' link.
But the following code will display the image without clicking 'show image'.
<?php
$eid=$_GET['mail'];
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsMail();
$mail->From = "example@mail.com";
$mail->AddAddress("$eid");
$mail->Subject = "sending image to mail";
$mail->IsHTML(true);
$mail->AddEmbeddedImage("image_03.gif","mailimage","image_03.gif","base64","image/gif");
$mail->Body="<table style='border: thin solid #4682B4; border-collapse: collapse;' align='center' width=100%> <tr><td><img src='cid:mailimage'></td></tr></table>";
if(!$mail->Send())
{
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
}
else
echo "Message sent";
?>
|
|
By raveendran, On - 2009-11-07 |
|
|
|