.NET equivilent of CDO AttachURL ?

  • Thread starter Thread starter Ricci Hammond
  • Start date Start date
R

Ricci Hammond

In asp you could use the attachmail method to embed an image in an html
email that would not show it as an attachment (no icon at the top in
outlook).

In .net I can create an email and attach images and have them display in the
email, but they are also shown as attachments (icon is displayed at top).

Is there anyway to get the same result as attachurl in .net ?

Thanks,

Ricci.
 
Hi Ricci,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to embed an image into you
HTML format mail. If there is any misunderstanding, please feel free to let
me know.

As far as I know, there isn't a managed class that can let us achieve this
in current version of .NET framework. We have two choices.

1. Use a third-party .net component. The www.aspNetEmail.com component has
the EmailMessage.EmbedImage() method to do this for you.

2. Use CDO interop. COM components offer more features than the built-in
System.Web.Mail. If you use CDOEX (CDO for Exchange 2000)/CDOSYS (CDO for
Windows 2000/.NET) you can use the CreateHTMLBody method of the CDO.Message
object which will and the whole HTML page and automatically embed the
images.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Thanks for your response.

I worked out the header that gives the result I want:

Content-Location: Logo.jpg

I have not found a way to set it for the attachment using the framework yet
(not even sure it is possible to edit the headers). But I use /n software's
ip*works and that comes with a mime control, this allows you to modify the
attachment headers so I have got it working with that.

Regards,

Ricci.
 
Back
Top