Lou
Lou

Reputation: 4484

Sending HTML in e-mail

I need my .NET desktop app to be able to send various HTML mails, allowing users to create custom templates, including images and possibly CSS style (if they copy/paste the HTML from other sources).

From what I've been reading, it's not that simple:

My questions are:

  1. Is there anything else I should take care of?
  2. Is there a library which already does this so that I don't reinvent?

Upvotes: 4

Views: 554

Answers (2)

Lou
Lou

Reputation: 4484

I have found the following CodeProject article, which describes how to embed various image resources into the mail:

It has some useful examples, although it doesn't seem to include an alternate plain text view, so I will have to add that.

It's still a pity that no-one has put together a library which does this stuff automatically.

Upvotes: 0

Bridge
Bridge

Reputation: 30711

One thing I can think of, make use of Alternate views for those recipients whose mail clients can't/won't accept HTML emails (or they've got it turned off). That way they'll get a plain text version, in which you could include a link to an html version live on the web if they decide want to view it.

I have also heard that not including a plain text version increases your likelyhood of being marked as spam - this is due to the fact that many mail filters compare the plain text and html versions of a message; if they differ too wildly it's not a good sign for you :-)

Other spam indicators include html messages which have more pictures than text, and generally sloppy html - broken css, bad links, missing tags etc - consider using some sort of markup validator before sending.

Upvotes: 3

Related Questions