关于发送EMAIL
我的Web程序调用这个函数
public bool Send(string SmtpServer, int Port, string UserName, string PassWord, string ADDRESS_FROM, string add_to, string title, string body)
{
DataSet ds = new DataSet();
SmtpClient mailClient = new SmtpClient(SmtpServer, Port);
mailClient.EnableSsl = true;
NetworkCredential crendetial = new NetworkCredential(UserName,PassWord);
mailClient.Credentials = crendetial;
MailMessage message = new MailMessage(ADDRESS_FROM, add_to, title, body);
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = true;
message.SubjectEncoding = System.Text.Encoding.UTF8;
try
{
mailClient.Send(message);
return true;
}
catch
{
return false;
}
}
SmtpServer="stmp.163.com" Port=25
运行错误提示:服务器不支持安全连接 这是什么意思上啊?哪错了?还是什么东西没配置?