Sponsored by
www.aspnetemail.com
|
 |
Discuss This FAQ Item
Got a question? Another Suggestion? Want to post your solution? Discuss it below.
-
Embed images in Email
[ Reply ]
I have done this so that an email is sent from a web site and an image from the website is embedded in the actual email (still shows as attachment obviously)
... msg.BodyFormat = MailFormat.Html; msg.Body = "<IMG SRC=\"cmsm1_multi.gif\">"; //only name of image file msg.Body += "Any other stuff for body"; ... MailAttachment imgObj = new MailAttachment(Server.MapPath("/") + "web/images/cmsm1_multi.gif"); //actual location of image file msg.Attachments.Add(imgObj); ... //send the message
Dave [ landerd ( at ) qnp dot newsltd dot com dot au ],
2004-03-16 16:26:37
#
-
RE: Embed images in Email
[ Reply ]
yeah, but send yourself the email, but don't look at it. Make sure it is downloaded to your client (outlook or outlook express).
Disconnect from the internet. While in offline mode, you will the image is broken. Sure the image is attached, but it's not embedded. Embedded images are where you can view the images, while in offline mode. No additional requests are made to the webserver.
You have to make sure you don't first view the image, because some clients will download the image and cache it.
hth, Dave
Dave Wanta [ dave ( at ) 123aspx dot com ],
2004-03-16 18:10:43
#
-
RE: Embed images in Email
[ Reply ]
By this way, the image is not embedded in the mail body but, it still goes with the mail as an attachment. So the recipient will be able to see the image in offline mode. This is the best way to send mails including images with System.Web.Mail if you are not using a third party product.
CeCHeN [ tezcan ( at ) docuart dot com ],
2004-12-02 07:01:40
#
-
RE RE: Embed images in Email
[ Reply ]
try this Mail.Body="<HTML><BODY BACKGROUND=""cid:My-Image"">...</HTML>" Mail.AddEmbeddedImage "c:\aspemaildir\margin.gif", "My-Image"
Rupan [ rupangupta ( at ) gmail dot com ],
2006-06-01 07:29:30
#
-
RE: RE RE: Embed images in Email
[ Reply ]
That isn't any method on the MailMessage class, either in 1.1 or 2.0. What library are you using?
Marc [ madacram ( at ) yahoo dot com ],
2007-03-16 10:14:51
#
-
RE: Embed images in Email
[ Reply ]
Even though images do show up in Outlook Express, they won't for Gmail. Anyway, thanks! It is better than none.
Zou Yu [ No1 dot Mail ( at ) gmail dot com ],
2006-01-27 07:48:53
#
-
RE: Embed images in Email
[ Reply ]
Hi All, Use CDOSYS to embed images in the mail. User CreateHTML method.
Search google for CDOSYS C#. CDOSYS is designed and developed from scratch. .NET uses CDOSYS.
Regards, (Varinder Hatta)
Varinder Hatta [ vhatta ( at ) pugmarks dot com ],
2006-07-17 01:07:42
#
-
RE: Embed images in Email
[ Reply ]
you cant embed images in an email
joe [ joe ( at ) aol dot com ],
2006-08-21 09:45:15
#
-
RE RE: Embed images in Email
[ Reply ]
Riiiight. What about all those Image SPAMs I get that don't actually download an image, but the image is actually in the header??
anonymous-coward [ test ( at ) test dot com ],
2007-07-03 15:05:33
#
-
RE: RE RE: Embed images in Email
[ Reply ]
I do it by creating the page with ms frontpage , then opening the file in IE... from IE select file, send by email... note that the images will need to be on a public internet server...
JDuke [ duque_jo ( at ) hotmail dot com ],
2008-01-29 17:00:01
#
-
RE: Embed images in Email
[ Reply ]
ok
Masabo [ kmasabo ( at ) yahoo dot com ],
2006-09-25 06:53:52
#
-
embedding images
[ Reply ]
where can I find an example or at least some hints about embedding images in an email?
razvan [ razdanro ( at ) yahoo dot com ],
2004-09-06 07:10:55
#
-
RE: embedding images
[ Reply ]
I'm assuming you read the above faq, so you need a 3rd party component.
Check out my component: aspNetEmail http://www.aspnetemail.com/help/welcome/sample_multipartembeddingimage.html
Cheers! Dave
Dave Wanta [ dave ( at ) 123aspx dot com ],
2004-09-06 07:15:49
#
-
RE RE: embedding images
[ Reply ]
So if it can't be done, how do the third party companies do it?
Bill [ notpublished ( at ) nothing dot com ],
2004-09-13 13:41:06
#
-
RE: RE RE: embedding images
[ Reply ]
well, in my case (and I'm sure the others), I wrote it from the ground up. aspNetEmail does not depend upon System.Web.Mail. Thus, I control what options I want to give the end developer for formatting their email message.
Cheers! Dave
dave wanta [ dave ( at ) 123aspx dot com ],
2004-09-13 13:43:36
#
-
RE RE: RE RE: embedding images
[ Reply ]
Can you please explain ground up method, any idea how to achieve image embeding in mail message...
Aatif [ aatif_malik ( at ) hotmail dot com ],
2004-10-05 00:48:35
#
-
RE: RE RE: RE RE: embedding images
[ Reply ]
Explain 'Ground Up'? Are you kidding. How about "start from scratch".
Brandon [ bcissell ( at ) thedailyread dot com ],
2004-12-01 06:58:45
#
-
RE RE: RE RE: RE RE: embedding images
[ Reply ]
----Explain 'Ground Up'? Are you kidding. How about "start from scratch". -----
Why not? Dont want to reveal your secrets?? Just give him a head start.
Craig
Craig [ craigcsb ( at ) hotmail dot com ],
2005-03-15 15:06:55
#
-
RE: RE RE: RE RE: RE RE: embedding images
[ Reply ]
Download the try version of aspNetEmail and than use reflector by Lutz Roeder. If this guy is not willing to give you a head start.
roel [ roel ( at ) ikke dot nl ],
2005-05-11 01:04:05
#
-
RE: RE RE: RE RE: RE RE: embedding images
[ Reply ]
Don't take it the wrong way, but be grateful for all free instruction and help Dave's already providing through this site.
Dave's has a commercial product that fills a market need that System.Web.Mail doesn't address. If I'd gone through the effort to create, market, sell, and support a commercial product to meet such a need, and someone said "can't you just tell me how to create your product?", I'd politely decline the offer as well.
Dan Kahler [ dan dot kahler ( at ) gmail dot com ],
2006-01-13 11:00:28
#
-
RE: RE RE: RE RE: RE RE: embedding images
[ Reply ]
How do I embed images in my Yahoo email?
Andy [ alfazulu7 ( at ) yahoo dot com ],
2006-05-10 07:08:47
#
-
RE: embedding images
[ Reply ]
How do I send an e-mail with an image in it, ie not as an attachment ??
Rob [ xesionprince ( at ) fsmail dot net ],
2005-05-25 04:20:41
#
-
RE RE: embedding images
[ Reply ]
Uuuh, maybe because it could take weeks?
Jon [ jon ( at ) basicillsion dot com ],
2005-06-01 17:52:33
#
-
RE RE: embedding images
[ Reply ]
'Send email message with free jmail, download it here: http://www.dimac.net/FreeDownloads/dlstart.asp?ProductID=5 ' Install in System32 and then register with "cmd /k regsvr32 c:\windows\system32\jmail.dll" ' Add as a reference JMail 4.0 library from COM tab
Dim jm As New jmail.Message
jm.Subject = "HTML with embedded image" jm.From = "a@b.ca" jm.FromName = "Fe La" jm.AddRecipient("fela@yahoo.ca") jm.Body = "A nice picture if you can read HTML-mail."
' The return value of AddAttachment is used as a ' reference to the image in the HTMLBody. Dim contentId As String contentId = jm.AddAttachment(System.AppDomain.CurrentDomain.BaseDirectory() & "cover.jpg", True, "image/jpeg")
Dim strContents As String strContents = "<html><body><font color=""red"">Hi, here is a nice picture:</font><br><img src=""cid:" & contentId & """><br><br>good one huh?</body></html>" jm.HTMLBody = strContents
' But as not all mailreaders are capable of showing HTML emails ' we will also add a standard text body jm.Body = "Too bad you can't read HTML-mail." jm.AppendText(" There would have been a nice picture for you")
jm.Logging = True jm.Silent = True If Not jm.Send("fela:my_password@smtp.mail.yahoo.ca") Then Console.WriteLine(" - Problem with sending email. JMail ErrorCode: " & jm.ErrorCode) End If
'End of Send email message
Gennady [ gkucheruk ( at ) yahoo dot ca ],
2005-06-02 13:36:54
#
-
RE: RE RE: embedding images
[ Reply ]
if you want to use a COM object it's too easy add a reference to CDOSYS.dll. Look at ..\system32 folder of your OS. Why download third parts COM objects?
ps: sorry for the language, i'm italian :-)
Gio [ mandalaqui ( at ) hotmail dot com ],
2005-06-17 09:41:00
#
-
RE: RE RE: embedding images
[ Reply ]
isn't there a way using html? I'm not a programmer... but looking at the source of other imaged emails I receive it looks possible?
andy [ andyodandy ( at ) gmail dot com ],
2008-09-16 16:25:17
#
-
RE: embedding images
[ Reply ]
'Send email message with free jmail, download it here: http://www.dimac.net/FreeDownloads/dlstart.asp?ProductID=5 ' Install in System32 and then register with "cmd /k regsvr32 c:\windows\system32\jmail.dll" ' Add as a reference JMail 4.0 library from COM tab
Dim jm As New jmail.Message
jm.Subject = "HTML with embedded image" jm.From = "a@b.ca" jm.FromName = "Fe La" jm.AddRecipient("fela@yahoo.ca") jm.Body = "A nice picture if you can read HTML-mail."
' The return value of AddAttachment is used as a ' reference to the image in the HTMLBody. Dim contentId As String contentId = jm.AddAttachment(System.AppDomain.CurrentDomain.BaseDirectory() & "cover.jpg", True, "image/jpeg")
Dim strContents As String strContents = "<html><body><font color=""red"">Hi, here is a nice picture:</font><br><img src=""cid:" & contentId & """><br><br>good one huh?</body></html>" jm.HTMLBody = strContents
' But as not all mailreaders are capable of showing HTML emails ' we will also add a standard text body jm.Body = "Too bad you can't read HTML-mail." jm.AppendText(" There would have been a nice picture for you")
jm.Logging = True jm.Silent = True If Not jm.Send("fela:my_password@smtp.mail.yahoo.ca") Then Console.WriteLine(" - Problem with sending email. JMail ErrorCode: " & jm.ErrorCode) End If
'End of Send email message
Gennady [ gennady ( at ) geriatricsandaging dot ca ],
2005-06-02 13:50:24
#
-
It IS possible, Just Use an RTF encoded email
[ Reply ]
Clearly you can create mime bodies with system.web.mail (although it isn't obvious) and if you render a message (including pictures) in rtf and then make rtf the message body, the images go along for the ride.
so it IS possible. Would love to see an example of someone who has send an RTF body message (NOT AN ATTACHMENT, but as the actual body)
good hunting
Jeff Gallino [ not ( at ) gonnahappen dot com ],
2005-08-02 07:15:31
#
-
RE: It IS possible, Just Use an RTF encoded email
[ Reply ]
So does anyone have a simple example of how to do this? I'm on a Mac. I have a very simple html doc with 1 image in it. Are there any tools to take my html and convert it to a sendable email format?
Any help is greatly appreciated, I'm on a deadline. Thanks, rich!
Richard Rabassa [ rabassa ( at ) lgaadv dot com ],
2005-09-13 05:59:36
#
-
RE RE: It IS possible, Just Use an RTF encoded email
[ Reply ]
Create your htm doc Open Outlook Express (as far as I know it can't be done in Outlook) , create a new mail Go to tools and "insert text from file" Select your html doc When the html loads up right click on the image, or where the image should be, and select properties. browse to Select the image from your hard drive Repeat for all images. Send the baby off :)
Michael [ it6 ( at ) tomatotechnologies dot com dot au ],
2005-11-20 21:06:04
#
-
How to embed images in RTF file
[ Reply ]
I m Creating a RTF file, by Transforming XML with a XSL file. In RTF file i m creating table and in table i have to add JPEG file at RUN time. XML file have path of JPEG file and other inforation.
Sudhanshu Bhatnagar [ sudhanshu_31 ( at ) yahoo dot com ],
2005-09-23 02:35:03
#
-
RE: How to embed images in RTF file
[ Reply ]
How do i embed a RTF file into an email. My file format is in rtf and i need to embed it into the email body
omlac [ kmakuwaza ( at ) yahoo dot com ],
2008-05-26 03:15:42
#
-
C# . NET
[ Reply ]
I am using C# .NET
I have got a table like structre where I am having some read only text boxes and labels where the data is populated based on some checks. I want to send the details in the same look to a mail account. Is it possible or I have to go for some work around.
Please suggest me how to do it .
Thanking in Advance.
sandeep [ sandeep_km2000 ( at ) rediffmail dot com ],
2005-10-04 06:13:31
#
-
embedding images in hotmail
[ Reply ]
is it at all possible to embed a photo or and image into a hotmail message
Jessie [ jessie551 ( at ) msn dot com ],
2005-12-07 01:24:16
#
|