我的代码,密码就不写出来了
MailMessage mail = new MailMessage();
mail.To = "qijianzhou289@sohu.com";
mail.From = "qi_jianzhou@126.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.BodyFormat = MailFormat.Html;//设置为HTML格式
//mail.Bcc = "webmaster@hellosea.com;bluewhale@hellosea.com;dhlhh@hellosea.com";
//设置为需要用户验证
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"

;
//设置验证用户名(把my_username_here改为你的验证用户名)
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "qi_jianzhou@126.com"

;
//设置验证密码(把password改为你的验证密码)
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password"

; // 这就不写密码了
SmtpMail.SmtpServer = "smtp.126.com"; //邮件服务器地址
SmtpMail.Send( mail );