1

How do I properly put images in emails using PHPMailer?

I have this code:

$mail->IsHTML(true);
$mail->Body = "Issue:<br/>".$issue."<br/><img src=$img_data/>";

But when I send it to gmail it already looks like this:

enter image description here

I'm using URI's to store the image data. How do I link this image in PHPMailer?

user225269
  • 10,743
  • 69
  • 174
  • 251

2 Answers2

2

look at this

question may be it will help you you can try this

Send email with PHPMailer - embed image in body

i hope it helps

Community
  • 1
  • 1
Rinzler
  • 2,139
  • 1
  • 27
  • 44
1

Try to put an ' in your img src property:

"<img src='$img_data'/>";
sephoy08
  • 1,104
  • 7
  • 16