smtp.ym.163.com 不要问我怎么知道
有认证吗?
嗯
之前试过了,当时报错:不允许使用邮箱名称。 服务器响应为:Requested action not taken: Local user only,smtp3,PdOowECZ80T0OgdXRpChAw--.170S3 1460091638
所以不对哎,知道怎么解决吗?
SmtpClient smtp = new SmtpClient();
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
if (_port != 25)
smtp.EnableSsl = true;
smtp.Host = _host;
smtp.Port = _port;
smtp.Credentials = new NetworkCredential(_username, _password);
MailMessage mm = new MailMessage();
mm.Priority = MailPriority.Normal;
mm.From = new MailAddress(_from, subject, _bodyencoding);
mm.To.Add(to);
mm.Subject = subject;
mm.Body = body;
mm.BodyEncoding = _bodyencoding;
mm.IsBodyHtml = _isbodyhtml;
try
{
smtp.Send(mm);
}
catch
{
return false;
}
再不明白去网上查查,有相关的资料