C#使用.net.mail配置163邮箱报错:不允许使用邮箱名称。 服务器响应为:authentication is required,smtp9,DcCowABHK4UYE11W2k6fAQ--.52196S2 1448940312
client.UseDefaultCredentials = true;
要放在
client.Credentials = new NetworkCredential("用户名", "密码");
的前面
var client = new SmtpClient()
{
UseDefaultCredentials = true,
Credentials = cre,
Host = CONSTANT.Host,
Port = CONSTANT.Port,
EnableSsl = false,
DeliveryMethod = SmtpDeliveryMethod.Network
};
文章来自:http://www.cnblogs.com/techfans/p/5009762.html