现在的位置: 首页 > 综合 > 正文

MVC 3.0邮件发送

2013年12月14日 ⁄ 综合 ⁄ 共 405字 ⁄ 字号 评论关闭

1】、配置邮件发送的参数

 //发送电子邮件的SMTP的服务器名称

 WebMail.SmtpServer = "smtp.gmail.com";

 //发送端口

  WebMail.SmtpPort = 25;

 

 WebMail.EnableSsl = true;

 //账户名 

  WebMail.UserName = "hedywqy"; 

  //邮箱名

 WebMail.From = "*****@gmail.com"; 

  //密码

 WebMail.Password = "*****";

 //设置默认配置

 WebMail.SmtpUseDefaultCredentials = true;

  ----------------------------------------------------------------------

 2、发送邮件】

 WebMail.Send(mailadress,subject,body);

 

 

 

【上篇】
【下篇】

抱歉!评论已关闭.