.net1.1下邮件发送(带验证)

?????? MailMessage mail = new MailMessage();
?????? mail.To = greystar@jbinfo.com.cn;
?????? mail.From = "greystar@jbinfo.com.cn;";
?????? mail.Subject = "Test";
?????? mail.Body = "TestBody";
?????? mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
?????? mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here"); //set your username here
????? mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret"); //set your password here

??? SmtpMail.SmtpServer = "mail.eqing.org";? //your real server goes here
??? SmtpMail.Send( mail );

posted @ 2004-08-17 10:27  greystar  阅读(133)  评论(0编辑  收藏  举报