Page 1 of 1
How to send an image inside HTML mail (with attachment)
Posted: Fri Jan 02, 2009 7:50 am
by mandingueiro
Hello people, what I want to do is to insert an image in an HTML email but not as an attachment neither as a remote image loaded from a url (with the <img> tag). I want to insert it just like the way you do it from Outlook, so they will be visible when someone reads the mail, and they dont have to open any attachment to view it.
Re: How to send an image inside HTML mail (with attachment)
Posted: Fri Jan 02, 2009 7:58 am
by The_Anomaly
I'd imagine outlook uses the img tag when in HTML mode, we just don't see it?
Re: How to send an image inside HTML mail (with attachment)
Posted: Fri Jan 02, 2009 11:37 am
by mandingueiro
Well I made a mistake. I dont want to send html mail, I just want to send an email with and img attached to it, but I want the image to be displayed inline, just like you see it if you send yourself an email from outlook using the "Insert picture" option. Outlook uses something like a hidden-attachment technique to do this.
Re: How to send an image inside HTML mail (with attachment)
Posted: Fri Jan 02, 2009 11:19 pm
by Chris Corbyn
Swift Mailer can do this. They're called embedded images

Re: How to send an image inside HTML mail (with attachment)
Posted: Sat Jan 03, 2009 6:49 am
by mandingueiro
Thanks for the tip. Can you tell me a little more about this technique? Or in which file of your program can I find it?
Edit: Well I've found the technique you use.
http://swiftmailer.org/wikidocs/v3/comp ... s_embedded
or here
http://swiftmailer.org/wikidocs/v3/tuto ... ing_images
But how can I use this piece of code and insert it to my script so I make it work?
In my script by the way, I use mail() function combined with sleep(1) to send the mail to multiple recipient (inside a for).