468,104 Members | 1,297 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,104 developers. It's quick & easy.

Sending HTML Email with images in C# 2.0

Hi,

I have a HTML page and associated images. I need to send the HTML as
email -the email should also display the images at respective places.
So am sending the content of HTML file as MailMessage.Body and adding
all the referred images using MailMessage.Attachments.Add().

The images referred using <IMG SRC="Logo.png" /are displaying
properly in the email, but the image referred by <TABLE
STYLE="background-color:#000000;background-image:url(Background.png);
width: 600px; height: 800px;"is not displaying in the mail and it
stays in the attachment section. Due to requirements I cannot modify/
replace background-image:url(Background.png); section in the STYLE
property.

Is there any way to embed the images inline in this context? Or is
there any way to render the the aforementioned Background.png image
from attachments?

Any inputs will be appreciated!

Thanks in advance.

Regards,

Aneesh P

Sep 5 '07 #1
2 4394
Hi,

"Aneesh Pulukkul[MCSD.Net]" <an******@gmail.comwrote in message
news:11**********************@19g2000hsx.googlegro ups.com...
Hi,

I have a HTML page and associated images. I need to send the HTML as
email -the email should also display the images at respective places.
So am sending the content of HTML file as MailMessage.Body and adding
all the referred images using MailMessage.Attachments.Add().

The images referred using <IMG SRC="Logo.png" /are displaying
properly in the email, but the image referred by <TABLE
STYLE="background-color:#000000;background-image:url(Background.png);
width: 600px; height: 800px;"is not displaying in the mail and it
stays in the attachment section. Due to requirements I cannot modify/
replace background-image:url(Background.png); section in the STYLE
property.

Is there any way to embed the images inline in this context? Or is
there any way to render the the aforementioned Background.png image
from attachments?
I think that it will depend of the way that the user read the email, did you
try a webmail system like hotmail, yahoo, gmail?
Sep 5 '07 #2
On Sep 5, 6:24 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions.comwrote:
Hi,

"Aneesh Pulukkul[MCSD.Net]" <anees...@gmail.comwrote in message

news:11**********************@19g2000hsx.googlegro ups.com...


Hi,
I have a HTML page and associated images. I need to send the HTML as
email -the email should also display the images at respective places.
So am sending the content of HTML file as MailMessage.Body and adding
all the referred images using MailMessage.Attachments.Add().
The images referred using <IMG SRC="Logo.png" /are displaying
properly in the email, but the image referred by <TABLE
STYLE="background-color:#000000;background-image:url(Background.png);
width: 600px; height: 800px;"is not displaying in the mail and it
stays in the attachment section. Due to requirements I cannot modify/
replace background-image:url(Background.png); section in the STYLE
property.
Is there any way to embed the images inline in this context? Or is
there any way to render the the aforementioned Background.png image
from attachments?

I think that it will depend of the way that the user read the email, did you
try a webmail system like hotmail, yahoo, gmail?- Hide quoted text -

- Show quoted text -
I was talking about the appearence of email in Outlook. As you ponied
I tried sending it to yahoo mail, here none of the images are coming
as expected. Images will appear as attachments only. Got to see one
AlternateView class, using which we can have images as
LinkedResources. Will try this out. Any thoughts?

Sep 5 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Damien | last post: by
4 posts views Thread by Martin W | last post: by
6 posts views Thread by Eduardo Rosa | last post: by
6 posts views Thread by ssankar | last post: by
1 post views Thread by runway27 | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.