Link to home
Start Free TrialLog in
Avatar of guster5k
guster5k

asked on

CDONTS - Embedded images don't show in web-based e-mail

Hello ppl,

I'm using CDONTS to send e-mails with HTML and embedded images. I can use outlook to see the e-mail and see the images, but if i try to open with a web-based e-mail i get a Big red X :(.

What it looks like is that my server is not giving the proper name for the AttachedURL, because i see a file without a name as an attachment in my e-mail.

I can't install other component at my server (i wish i could).

Does anyone have a solution for that?

Thanks a lot.
Avatar of Sukamal_Sengupta
Sukamal_Sengupta

Hi guster5k,

People often think that when they send an HTML image that has embedded images, that they are actually sending the images with the email. This is incorrect. In fact, you are sending directions in the HTML code, which instructs the recipient where they can find the images.

Most email companies will require that the images for your HTML email message be hosted on your server. And you'll want to make sure that each image is given an "absolute reference." This means you'll need to use the image's whole address because the browser has to locate your site on the web to retrieve the image.

The Wrong Way to Link Images...
-------------------------------------------------
/images/picture.jpg

The Right Way to Link Images...
--------------------------------------------------
http://www.test.com/images/picture.jpg

The difference between these two images is the first will work only when you view it on your company's website. The "absolute reference" will work when anyone with HTML capabilities who is connected to the web opens it.


If you still getting the error then i think not all the web based email goes not support html based contents. Like rediffmail, gmail etc.

For yahoo it is ok but you have to choose "view html content email" option on.

Hope your probel will be solved.

Thanks and Regards,
Sukamal Sengupta
Attaching them means they have to be opened and used and web based mail doesn't do this unless you specifically open them.

The best way is put external links to your images in the email. This keeps the email size small and doesn't rely on the tricky bit of getting your HTML code to recoginise the attached files esp if it's web based email. When they open the email, the images will load from the web like a webpage.

Yeah! What S.S. said.
ASKER CERTIFIED SOLUTION
Avatar of sudheeshthegreat
sudheeshthegreat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

Hi sudheeshthegreat,

I think there is no problem in the mail sending code which guster5k use otherwise he could not be able to see it in outlook.

The only problem is viewing the picture.

Thanks,
Sukamal Sengupta
>>The only problem is viewing the picture.
now, why is there a problem? you can either have a link to the image or you can embed the image.
if it is a link, what you (Sukamal_Sengupta) pointed out is correct. it should be an absolute URL.
but, if it is embedding an image, simply putting html with image tags won't do. if you have a look at the html source of mails where the image is embedded, you can see a CID (Content ID) created instead of a link and the above code I wrote is the way to get it.

please note that embedding images in mail would increase the mail-size to include the size of the image. but, if it is just a link to the image, it is as good as simple html.