Jump to content

help including image in email


MDanz

Recommended Posts

 $to = $email;
              $subject = "Activate your account!";
              $headers = "From: admin@default.com";
              $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
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. :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.