Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

In my project, i am sending email using outlook , before sending it preview email is generated. Images looks fine in preview , but when email is sent then the embedded image is converted to attachment sometimes. This depends on the size of embedded image.

To create the outlook email preview i am using .html file with the help of which i am embedding the image in body like this

<!--customTag tag="img" width="246" height="31" src="BodyPart(CR_Logo_Top.png)" closing="self" content=""-->
<img width=246 height=31 src="./CR_files/CR_Logo_Top.png"/>
<!--/customTag-->

Image actual size is 246x31. Irrespective of image size i provide in img tag email preview is coming correct. But problem start when email is sent.

For example with 220x31 and 467x51 images come correct in both preview and sent mail.
But with size 246x31 images come correct in preview but not sent properly in sent mail , in sent mail they come as attachment instead of embedded image.

I tried to inspect the element in browser , i found that when image is sent properly src tag looks like
<IMG id=Picture_x0020_1 alt="cid:bodyPart/CR_Logo_Top.jpg" src="cid:image001.jpg@01D104DD.CC1F9380" width=230 height=31>

But when image is not sent properly then src tag looks like
<IMG id=Picture_x0020_1 alt="cid:bodyPart/CR_Logo_Top.jpg"
src="cid:CR_Logo_Top.jpg" width=246 height=31>

Please can anyone tell where the things are going wrong and what can be possible reason so that i fix the issue.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900