Note Compiling under VS2003 can be passed .System.Web.mail.mailMASSAGE MAIL = New System.Web.mail.mailMAILMESAGE ();
// Define the send address of the email mail.from = "aierong@126.com";
// Define the receiving address of the message // Set the list of recipients with a semicolon-separated list mail.to = "aierong@126.com";
// Define the Dark Address of the Mail // Set by Sex Separated Email Address Mail.bcc = "A@126.com";
// Define the copy address of the message // set by a semicolon-separated email address list mail.cc = "abc@371.net; aaa@263.net";
// Define the subject mail.subject = ". Net email"; Net email ";
// Set the content type of the e-mail body // Here we send mail.bodyformat = system.Web.mail.mailFormat.html in HTML format;
// Set the body of the email mail.body = "Go Go Go";
// Set an attachment system.web.mail.mailattachment mailattachment = new system.web.mail.maiLattachment (@ "d: /abc.doc");
// Email Additional Annex mail.attachments.add (MaiLattachment);
// SMTP server // Many SMTP servers require authentication system.Web.mail.smtpmail.smtpserver = "smtp.126.com";
// Verify mail.fields.add ("http://schemas.microsoft.com/cdpo/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);