我正在尝试使用带有 Mandrill SMTP 服务的 Serilog.Sinks.Email NuGet 包(v1.5.0.0)发送电子邮件。以下代码执行但不发送任何电子邮件。当我尝试使用 System.Net.Mail.SmtpClient 使用相同的凭据时,它可以工作并发送电子邮件。
EmailConnectionInfo info = new EmailConnectionInfo()
{
EmailSubject = "Email subject",
FromEmail = "from@gmail.com",
MailServer = "smtp.mandrillapp.com",
NetworkCredentials = new NetworkCredential("mandrill_username", "mandrill_apikey"),
Port = 587,
ToEmail = "to@gmail.com"
};
Log.Logger = new LoggerConfiguration()
.WriteTo.Email(info)
.CreateLogger();
Log.Error("Houston we have a problem");