473,396 Members | 1,766 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,396 software developers and data experts.

html email with embedded images

Hi,

I know how to send emails from the .Net environment, even html mails.
But, what is the best way to add images to the html?

A URL to an image somewhere on some server is usually blocked nowadays,
so you need to send the image as attachment. I had some success when I
used the filename (without path) of the attachment as img-src.
Is that the only way or are there better methods?

A related question: some of these images might be stored in the database
or generated "on the fly", but the MailAttachment class uses filenames.
Is there any way to attach some document *without* storing it first?
If not, can I safely delete that temporary file directly after I send the
email to the server?

Hans Kesting
Nov 18 '05 #1
1 1468
I don't believe you can embed images into an email with the .net mail.

I also have to send out email's with embedded images that came from a
database. I basically had to write my own SMTP client to replace the built
in .net version. You can also purchase a 3rd party package that will do
this. (I couldn't since our product is resold and it would cause licencing
issues)

Unfortunally I can't send my code...they would probably fire me! But I can
offer you a few pointers on what you should do. Writing you're own SMTP
client isn't as easy as it sounds....there's a lot of standards to follow.
I strongly recommend that you use a 3rd party package...maybe this:
http://www.quiksoft.com/emdotnet/comparison.asp

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:OZ***************@TK2MSFTNGP11.phx.gbl...
Hi,

I know how to send emails from the .Net environment, even html mails.
But, what is the best way to add images to the html?

A URL to an image somewhere on some server is usually blocked nowadays,
so you need to send the image as attachment. I had some success when I
used the filename (without path) of the attachment as img-src.
Is that the only way or are there better methods?

A related question: some of these images might be stored in the database
or generated "on the fly", but the MailAttachment class uses filenames.
Is there any way to attach some document *without* storing it first?
If not, can I safely delete that temporary file directly after I send the
email to the server?

Hans Kesting

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: comcast news | last post by:
at least i think it this is the problem am trying to fix a webpage/javascript that i didn't write www.deltaneutral.com when invoked or any new page from the menu, get the error msg line 2...
7
by: TLMM | last post by:
I have an HTML page which is a newsletter. I want to be able to add it to an email message so I can email it to people. I want it to be in the body of the email, not sent as an attachment. There...
3
by: T.Michelle | last post by:
We have few Mail templates (.html) which we use to send mails. We want to have some Logo in that ie ... when I send the mail to user the image should go as in-line embedded image in mail....
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...
3
by: marsandys | last post by:
Hello, I have this code below, which I am trying to have it send HTML formatted mail with embedded images. I can get this to send the mail, but it spits out a bunch of junk . I know this should...
6
by: Chris Cox | last post by:
I'm trying to put together a simple access database that will allow a friend to maintain a simple database of products/pictures/prices, which he can then export to html and upload to a website. ...
3
by: John Mark Howell | last post by:
I've got a MIME message that was originally an HTML email with embedded images. When the email is received (to GMail) it is now in MIME format. The HTML portion is now split out into the HTML and...
1
by: mark | last post by:
I'm using System.Net.Mail to send HTML email. I have a few images embedded within the HTML body. What's the most efficient way of including these images with the message or getting the images to...
0
digicrowd
by: digicrowd | last post by:
http://bytes.com/images/howtos/applemail_sig_icon.jpg At first glance, it may not appear that Apple Mail (otherwise known as Mail.app) supports the use of HTML signature emails. However, with a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.