当我部署它时,此代码在我的本地机器上运行良好。它给出了Failure sending mail
错误..请帮助...
MailAddress addrsTo = new MailAddress(toEmail);
MailAddress addrsFrom = new MailAddress("XXX@XXX.com", "XXX Title");
MailMessage mailmsg = new MailMessage(addrsFrom, addrsTo);
mailmsg.Subject = mailSbjct;
mailmsg.Body = "XXX Body";
SmtpClient smtp = new SmtpClient("mail.XXX.com");
smtp.EnableSsl = false;
smtp.Port = 26;
smtp.Credentials = new NetworkCredential("XXX@XXX.com", "XXXXXXX");
try {
smtp.Send(mailmsg);
} catch (Exception exc) {
throw new XXXException(1234, "---" + exc.Message);
}