本地MVC UserManager.sendasync效果很好。但是,当我实例化电子邮件服务并尝试发送电子邮件时...没有骰子。我做了一个PHP脚本来发送电子邮件。出色地工作非常容易。我也尝试下载和使用Mailkit ...没有骰子。我不确定在这里做什么。没有错误消息
var mimeMessage = new MimeMessage();
mimeMessage.From.Add(new MailboxAddress("System", "system@my.hypertarget.io"));
mimeMessage.To.Add(new MailboxAddress("Jason", "unblockgames@gmail.com"));
mimeMessage.Subject = "Test";
mimeMessage.Body = new TextPart("plain"){Text = message};
using (var client = new SmtpClient())
{
// For demo-purposes, accept all SSL certificates (in case the server supports STARTTLS)
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
client.Connect("relay-hosting.secureserver.net", 25, false);
client.Capabilities &= ~SmtpCapabilities.Pipelining;
client.Send(mimeMessage);
client.Disconnect(true);
}