473,564 Members | 2,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Embedded graphics in email messages

1 New Member
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(strin g 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 ((_emailTypePre ference == HTML_format_emb edded) || (_emailTypePref erence == HTML_format_att ached))
{
gifImage = new MailAttachment( "D:\\temp\\eBil l_email_hdr.gif ");
Message.BodyFor mat = MailFormat.Html ;
Message.Attachm ents.Add(gifIma ge);

} // end if


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

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

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

Similar topics

2
3548
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 to me. I recently created a BBS (Bulletin Board Service) on my website where I allow people to post messages via a form. It just occurred to me that...
14
3081
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 to do this? E.g. I want to be able to graph a function. At this point I'm not up to a level in C++ where I want to start learning Visual C++ so I...
10
4426
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 Enterplise Linux 3 ES, and applied FixPack fp5_mi00069.tar to it. After creating an instance, starting the database, creating a database, and entering...
2
2633
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 the scope of the assignment. Among the functions that it provides is the ability to embed the source documents in the database using OLE. The user...
1
1971
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 Some significant recent price reductions
4
1700
by: Arda Coskun | last post by:
Hi, How to create embedded graphics and audios? Any article would be helpful. Kind regards,
3
1622
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 running Windows CE 4.2. At first I was planning on using C# with the compact frame work but the more I learn about the project, the less comfortable I...
7
2566
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 stupid or missing the point. I used DrawString( ) as a simple test but I cannot get it to work at all unless I handle my custom controls Paint event.
5
1699
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 what group they belong to. Can drop-downs have such graphics as opposed to just text? TIA
0
7665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.