DotNetOpenMail  

 

 • Home

 • Overview

 • Examples

 • More Examples

 • Documentation

 • Download

 • Changelog

 • Project Home

 • Forums

 • Announcements

SourceForge.net Logo

Support This Project

 

Overview

 
What is DotNetOpenMail?
DotNetOpenMail is an open-source library written in C# for assembling and sending HTML and plain-text email with file attachments using Microsoft's .Net development framework. It is intended to provide a simple interface to create professional-looking email, yet give an advanced programmer more power over how the email is created.
 
How do I keep up-to-date with the latest releases?
Please subscribe to the Announcment List to find out when updates have been released.
 
Why not use the System.Web.Mail library?

If System.Web.Mail does what you want it to do, great. But the feature set is very limited, especially compared with other similar libraries like JavaMail. Plus, it's just an interface to CDONTS, and I think it's better to "go native" with .Net.

The philosophy of System.Web.Mail is to allow you to create a very simple email, simply, but if it doesn't do what you want, you're out of luck.

The philosophy of DotNetOpenMail is to make it simple to create a professional-looking email, but still allow a programmer to do customize it however he wants.

 
What do I need in order to use DotNetOpenMail?
You need an SMTP server and a .Net program to access the DotNetOpenMail API. (It is a programming library only, and doesn't have a user interface.)
 
Can I create email with HTML formatting? What about people who can only read plain text email?
Yes, you can create plain-text email and/or HTML email. These dual-format emails are in "multipart/alternative" MIME format, meaning that when someone opens an email, he will only see the part that his email reader can read. The vast majority of readers will see only the HTML part, but the minority of text-only readers will still be able to see the text content you provide.
 
Can I send attachments?
Yes, you can send files as external attachments that a user can click on (multipart/mixed format), and/or as inline images (multipart/related format). You can write them in memory or read them from disk.
 
Can I send characters other than the standard 7-bit ascii characters?

Yes, both the text and HTML attachments are (by default) sent in quoted-printable, iso-8859-1 (Western European) encoding, but you can use any encoding supported by your .Net development environment. There is an example for sending a Japanese email.

 
Can I do a mail merge? How to I generate the HTML?
DotNetOpenMail doesn't help with mail merging, but it's trivial to do. If you find that you need to do a lot of different template-based mailouts, or if you just like the idea of having good Model/View/Controller separation, you may want to try NVelocity as a templating engine.