0

hi i want to send a image in html format using php mailer class but image show in mail after downloading. but i want to display the image without downloading. is there any option in mailer class or there is another method for this. or i have to send the the image in another format.

skolima
  • 31,963
  • 27
  • 115
  • 151
Badshah
  • 69
  • 2
  • 7

3 Answers3

1

Well, there can be only two possible answers:

  • you do not want to embed the actual image file with the eMail, then simply put an <img> element into the eMail linking to the image at the remote location, just like you would with any other HTML page. Then cross fingers and hope the client has HTML email enabled and allows display of remote images.

or

Community
  • 1
  • 1
Gordon
  • 312,688
  • 75
  • 539
  • 559
0

buddy, its really simple. Write html code as if you write in developing a web page. Give the complete url to the image in the src attribute.

Dont forget to user the function eregi_replace() on body html

$html_message = eregi_replace("[\]",'',$body_html_string);

engoy !!!!! ;)

Talha
  • 1,546
  • 17
  • 15
0

If your using PHP Mailer...

$mail = new PHPMailer();    
$mail->SetFrom("blah@blah.com");
$mail->AddAddress("blah@blah.com");
$mail->Subject = "Blah"
$mail->MsgHTML('<html><body><img src="logo.jpg">Hello</body></html>');
$mail->AddAttachment("logo.jpg");
$mail->Send();

Using AddAttachment PHP Mailer will check your HTML for a reference to that file and automatically embed it for you.

fire
  • 21,383
  • 17
  • 79
  • 114