System.Net.Mail FAQ

Complete FAQ Listing

3 Quickstart Programming Samples Printer Friendly

This System.Web.Mail QuickStart is a series of samples and supporting commentary designed to quickly acquaint developers with the syntax of sending email in .NET. The QuickStart samples are designed to be short, easy-to-understand illustrations of System.Net.Mail.

Important: When testing these samples, always be sure to:
1. Have a reference set to the System.dll.
2. If you are using C#, be sure the "using System.Net.Mail;" statement is found at the top of your code. Or, if you are using VB.NET, be sure the "Imports System.Net.Mail" statement if found at the top of your code.
3. Set the correct FROM and TO addresses.
4. Set the SmtpMail.SmtpServer to a valid server that allows relaying for your FROM email address or the IP address you are sending email from.