.net自带的mail组件

MailMessage mail = new MailMessage();
mail.From 
= "发送者的Email";
mail.To 
= "接收者的Email";
mail.Subject 
= "主题";
mail.Body 
= "内容";
mail.BodyFormat 
= MailFormat.Html;//用html格式
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate""1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername""邮箱用户名"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword""邮箱密码"); //set your password here
SmtpMail.SmtpServer = "smtp.126.com";//这里写邮局地址
SmtpMail.Send(mail);

posted on 2005-03-12 23:19  黎宇  阅读(477)  评论(1编辑  收藏  举报

导航