473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Embedded graphics in email messages

I am trying generate an HTML email message with C# Visual Studio 2003 that has a graphics file embedded in the message. (I know i should be using 2005 and the new classes there, but I cannot upgrade yet due to the policy at my company)

my function seems pretty simple. but what i get is an HTML email that has an attached file, whic his the graphics file. But I would like to have the graphics image embedded inside the email, so it displays with the email.

what am i missing here? do i need to reference the attached gif file from my html email source? it is current reference just by file name. how do i reference the attachment in my html source?

thanks for any help
wulongtea
==============================

public bool SendEmail(string strFrom, string strTo, string strSubject, string strBody)
{

MailMessage Message = new MailMessage();
MailAttachment gifImage;

Message.To = strTo;
Message.From = strFrom;
Message.Subject = strSubject;
Message.Body = strBody;


//
// if we're sending out an html email, then attached the gif image to the email
//
if ((_emailTypePreference == HTML_format_embedded) || (_emailTypePreference == HTML_format_attached))
{
gifImage = new MailAttachment("D:\\temp\\eBill_email_hdr.gif");
Message.BodyFormat = MailFormat.Html;
Message.Attachments.Add(gifImage);

} // end if


//
// Send the msg
//
try
{
SmtpMail.Send(Message);
} // end try
catch (Exception ex)
{
_objUtil.AppendToLogFile("*** Error: SendEmail: " + " Exception Message: " + ex.Message);
} // end catch
// SMTP.Send(msg);
return true;
} // end SendEmail

=============================
Jun 14 '06 #1
0 5095

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Aquarius2431 | last post by:
Hi!, I don't think I have posted to this group before. Have been using PHP on my webserver for a few months now and finding that I like it quite a bit. Here is a question that just occurred...
14
by: Pmb | last post by:
At the moment I'm using Borland's C++ (http://www.borland.com/products/downloads/download_cbuilder.html#) I want to be able to take an array of points and plot them on the screen. Is there a way...
10
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
2
by: Chris Belcher | last post by:
First some background... The database tracks Action Items assigned to a group of 20 or so managers. Once the assignment is created it is then emailed to each of the managers that are included in...
1
by: Chris Stephens | last post by:
The Spring 2004 copy of our Embedded Development Tools Newsletter is now available for downloading from our web site It includes information about...... An affordable USB protocol Analyser ...
4
by: Arda Coskun | last post by:
Hi, How to create embedded graphics and audios? Any article would be helpful. Kind regards,
3
by: Joe Thompson | last post by:
Hi, I tried posting this in a different thread a week ago but only received one response so I will try again here. I am writing the code for a program that will run on an embedded PXA255...
7
by: Peter Row | last post by:
Hi, I've started work on my own control some parts of which use standard controls, others I need to draw on my controls surface to get the display output I require, however.... I seem to be...
5
by: Mark B | last post by:
I'd like to have a field in a gridview (or standalone on a webpage) that not only drops down each salespersons name but also precedes their name with a blue, red, green or orange dot icon depicting...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.