sending embeded image in html mail using phpmailer class

how to send the embeded image in html mail using phpmailer class

Page 1 of 1

1 Replies - 15265 Views - Last Post: 09 January 2010 - 05:05 AM Rate Topic: -----

#1 it_1   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 15
  • Joined: 10-August 09

sending embeded image in html mail using phpmailer class

Posted 09 January 2010 - 04:48 AM

Hi ,

am using php mailer class to send the embeded image in html mail,in that running the script its getting Could not instantiate mail function.

please help me to resolve that issue.

am using php5.0 version

here am attached my code also.

<?
include("class.phpmailer.php");
include("class.pop3.php");
include("class.smtp.php");
$mail = new PHPMailer();
//$mail->IsSMTP(); // telling the class to use SMTP
//$mail->Host = "apprelay.trc.com"; // SMTP server
$mail->Encoding ="base64";
$mail->IsMail();
$mail->From     = "[email protected]";
$mail->FromName = "Mailer-Today";
$mail->AddAddress("[email protected]"); 
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/alternative";
$mail->AddCustomHeader($headers);
$mail->WordWrap = 50;                              // set word wrap
$mail->AddEmbeddedImage("GM Community Profile Image.jpg", "my-attach", "image/jpeg");
$mail->Body = '<img alt="PHPMailer" src="cid:my-attach">  ';
$mail->IsHTML(true);                               // send as HTML

$mail->Subject  =  "image !!!!!!!!";
$mail->AltBody  =  "This is the text-only body";

if(!$mail->Send())
{
   echo "Message was not sent <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;
   exit;
}
else
{
	echo "Message has been sent";
}
?>


*** MOD EDIT: Added code tags. Please :code: ***

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: sending embeded image in html mail using phpmailer class

#2 Auzzie   User is offline

  • D.I.C Addict
  • member icon

Reputation: 43
  • View blog
  • Posts: 573
  • Joined: 20-January 09

Re: sending embeded image in html mail using phpmailer class

Posted 09 January 2010 - 05:05 AM

first off, put your code in between the [ code ] BBTags, secondly can you send email's normally or isn't it letting you send emails at all?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1