Monday, September 8, 2008

System.Net.Mail FAQ

Frequently Asked Questions for System.Net.Mail
By Dave Wanta

This FAQ addresses the System.Net.Mail (SNM) namespace found in the 2.0 .NET Framework.

It starts with an Introduction and Programming Samples.

If you need to support the 1.x .NET Framework, be sure to check out my System.Web.Mail website here.

1 Introduction
1.1 What is System.Net.Mail?
1.2 What is the .NET Framework ?
1.3 What do I need to send email in .NET?
1.4 What is a relay server?
1.5 What is the IIS SMTP Service?
1.6 Can System.Net.Mail read email?
2 Exploring System.Net.Mail Classes
2.1 MailMessage Class
2.2 MailAddress Class
2.3 Attachment Class
2.4 SmtpClient Class
2.5 AlternateView Class
2.6 Linked Resource
3 Quickstart Programming Samples
3.1 Working with the Body
3.1.1 How do I send a plain text email?
3.1.2 How do I send a simple Html email?
3.1.3 How do I create a Multi-Part mime message?
3.2 Working with Addresses
3.2.1 How do I change the FROM address to a friendly name?
3.2.2 How do I change the TO address to a friendly name?
3.2.3 How do I specify multiple recipients?
3.2.4 How do I create a friendly non-ascii display name?
3.3 Working with Headers
3.3.1 How do I change the email priority?
3.3.2 How do I add the Reply-To header to the MailMessage?
3.3.3 How do I request a read receipt?
3.3.4 How do I add custom headers to the MailMessage?
3.4 Working with Attachments
3.4.1 How do I send an email with attachments?
3.4.2 How do I create an attachment from a stream?
3.5 Accessing Config File Mail Settings Programmatically
4 Advanced Programming Samples
4.1 How do I read SMTP configuration data?
4.10 How do I create a log file of the SMTP session?
4.11 How do I encrypt messages using s/mime or pgp?
4.2 How do I authenticate to send an email?
4.3 How do I change the SMTP port number?
4.4 How do I embed images in an email?
4.5 How do I send an email over SSL?
4.6 How do I send email asynchronously?
4.7 How do I write to the Pickup directory?
4.8 How do I send a web page?
4.9 How do I send non US-ASCII emails?
5 Troubleshooting System.Net.Mail
5.1 Bccs are not so blind.
5.2 Cannot enable SSL with a username and password.
6 Additional Help


ASP.Net Feeds