我在网上搜了下代码都发送不鸟邮件,都是报 邮箱不可用。 服务器响应为: Óû§±»Ëø& 或者类似的错误,哪位高手请 试试看向 zhangxinpingit@163.com zhangxinpingit@yahoo.cn zhangxinpingit@sina.com zhangxinpingit@gmail.com 这几个邮箱发送一个邮件试试, 内容就是 密码:aaa 就行了
高手们救命呀!!!
public static void sendEmails(string mailTo, string mailSubject, string mailBody)
{
MailMessage mail = new MailMessage();
SmtpClient smtpClient = new SmtpClient();
try
{
MailAddress fromAddress = new MailAddress("zhangxinpingit@163.com");
mail.From = fromAddress;
mail.To.Add(mailTo);
mail.Subject = mailSubject;
mail.Body = mailBody;
smtpClient.Host = "smtp.163.com";
mail.IsBodyHtml = true;
smtpClient.Credentials = new NetworkCredential("zhangxinpingit", "aaa");
smtpClient.Send(mail);
}
catch
{
}
}