472,960 Members | 1,729 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,960 software developers and data experts.

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 4614
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Damien | last post by:
Hi to all, After hours of attempts and "googling", I'm still pulling my hair off my head when I try to send multipart html emails. It "works" on PCs with Outlook when I juste send a single...
4
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text...
5
by: BaWork | last post by:
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it...
4
by: Martin W | last post by:
Hello, My application sends Emails using the SmtpMail class and I am reading a HTML page which is then used as the body for my email.Now this web page has got images also How would I map the...
6
by: Eduardo Rosa | last post by:
Somebody knows how I queue email using .Net? thanks a lot
0
by: shaolinman829 | last post by:
My collegue and I are at the point of pulling our hair out. I'm currently writting a little piece of Java code to send an email confirmation page that sends both html and text. Not a problem. In my...
6
by: ssankar | last post by:
hi all - I have been tasked to send customized emails to a set of users based on a certain condition in my company. ( This is NOT SPAM ) I have used MIME::Lite successfully to send html...
7
by: undbund | last post by:
Hi I am creating a newsletter system. The software should run from desktop computer (localhost) but be able to send email to anyone on the internet. Can you guys give me some ideas on how to...
1
by: runway27 | last post by:
<?php $headers = "Content-type: text/html; charset=iso-8859-1"; $to="myemailaddress"; $subject="Email Newsletter"; $message = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.