Note that the SDK can be compiled under VS2003.
System. Web. Mail. MailMessage mail = new System. Web. Mail. MailMessage ();
// Define the mail sending Address
Mail. From = "aierong@126.com ";
// Define the email Receiving address
// Set a list of recipient email addresses separated by semicolons
Mail. To = "aierong@126.com ";
// Define the mail's dark sending Address
// Set the list of email addresses separated by semicolons
Mail. Bcc = "a@126.com ";
// Define the CC address of the email
// Set the list of email addresses separated by semicolons
Mail. Cc = "abc@371.net; aaa@263.net ";
// Define the subject of the email
Mail. Subject = ". net email ";
// Set the email body content type
// Here we send the message in HTML Format
Mail. BodyFormat = System. Web. Mail. MailFormat. Html;
// Set the email body
Mail. Body = "go ";
// Set an attachment
System. Web. Mail. MailAttachment mailAttachment = new System. Web. Mail. MailAttachment (@ "d: abc.doc ");
// Add an attachment to the email
Mail. Attachments. Add (mailAttachment );
// SMTP Server
// Authentication is required for many SMTP servers
System. Web. Mail. SmtpMail. SmtpServer = "smtp.126.com ";
// Verify
Mail. Fields. Add ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1 ");
// Login Name
Mail. Fields. Add ("http://schemas.microsoft.com/cdo/configuration/sendusername", "aierong ");
// Login Password
Mail. Fields. Add ("http://schemas.microsoft.com/cdo/configuration/sendpassword ","*******");
// Send
System. Web. Mail. SmtpMail. Send (mail );