.net服务器端465端口发送邮件
MailMessage mmsg = new MailMessage();
//邮件主题
mmsg.Subject = "记忆2030机构入驻审核情况通知";
mmsg.BodyFormat = MailFormat.Html;
//邮件正文
mmsg.Body = "邮件正文"
//正文编码
mmsg.BodyEncoding = Encoding.UTF8;
//优先级
mmsg.Priority = MailPriority.Normal;
//发件者邮箱地址
mmsg.From = "memory2030@vip.163.com";//发件人地址;
//收件人收箱地址
string email_address = db_join.ContactEmail + "";
if (!string.IsNullOrWhiteSpace(email_address))
{
mmsg.To = "yfj@sjune.cn;tangyue@sjune.cn;eli.liu@sjune.cn";//收件人地址
}else {
mmsg.To = email_address + ";yfj@sjune.cn;tangyue@sjune.cn;eli.liu@sjune.cn";//收件人地址}
mmsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
//用户名 mmsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "登录名");
//密码 mmsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "密码");
//端口
mmsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "465");
//是否ssl
mmsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "true");
//Smtp服务器
System.Web.Mail.SmtpMail.SmtpServer = "smtp.vip.163.com";
try
{
SmtpMail.Send(mmsg);
Response.Write("发送成功");
}
catch (Exception ex)
{
Response.Write("发送失败,失败原因:" + ex.Message);
}
如有问题,请加我QQ:631931078或352167311