Jump to content

help including image in email


MDanz

Recommended Posts

 $to = $email;
              $subject = "Activate your account!";
              $headers = "From: [email protected]";
              $server = "http://www.default.com";
              
              ini_set("SMTP",$server);
              $body="
              
              Hello $fullname, \n\n
              
              You need to activate your account to participate in stackway.  Follow the link below:
              http://www.default.com/activate.php?id=$lastid&code=$random\n\n
               \n\n

          
              

              ";

 

this is the email that is sent to people that register.  How do i include an image?  I tried image source, but it doesn't work, when i check my email. I want the logo for my site in this email.  any ideas?

 

Link to comment
https://forums.phpfreaks.com/topic/180936-help-including-image-in-email/
Share on other sites

When you tried image source did you use absolute link instead of relative link?

 

So when you display image it should go along the lines of <img src="http://yourdomain.com/image/to/path" width="" height="" alt="" /> Then it should work.

 

Along with having the header stating that there is html and image file in the email. http://php.net/manual/en/function.mail.php That page should help you as far as what headers you need in this case.

 

Hopes that helps you out. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.