我使用下面的代码位从我的网络服务发送电子邮件
var emailMessage = new MailMessage(fromaAdress, toAdress)
{
Subject = subject,
IsBodyHtml = true,
Body = body
};
var smtp = new SmtpClient()
{
Host = "smtp.sendgrid.net",
Port = 25,
EnableSsl = false,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new NetworkCredential("xxxxx", "xxxxxx"),
Timeout = 10000
};
smtp.Send(emailMessage);
有人可以帮我找到问题。
提前致谢。