stevesimo Posted April 10, 2008 Share Posted April 10, 2008 Hi, I have a script which sends and email to a given email address. This works fine however I want to also embed an image into the email. Does anyone know if this is possible and if so how do I achieve it. Here is my email code: $to = $useremail; $subject = "Email Subject"; $body = "My email content"; mail($to, $subject, $body); Many thanks,Steve Link to comment https://forums.phpfreaks.com/topic/100484-email-image-using-php/ Share on other sites More sharing options...
poleposters Posted April 10, 2008 Share Posted April 10, 2008 Hi Steve, Its possible. First you need to modify the headers to instruct the email client to interpret the email as HTML, then include the relevant HTML tags to display the picture hosted on your server. You can also sent the email with the picture as an attachment. Remeber that not all email clients interpret HTML either by default or at all so you have to encode the email to be sent as HTML and plain text. There is a great article by Kevin Yank at sitepoint that will guide you through it. http://www.sitepoint.com/article/advanced-email-php/ Cheers, Matt Link to comment https://forums.phpfreaks.com/topic/100484-email-image-using-php/#findComment-513907 Share on other sites More sharing options...
stevesimo Posted April 11, 2008 Author Share Posted April 11, 2008 Thanks for the help Matt, that has helped a lot Cheers, Steve Link to comment https://forums.phpfreaks.com/topic/100484-email-image-using-php/#findComment-514685 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.