2
我正在嘗試使用Serilog.Sinks.Email NuGet包(v1.5.0.0)與Mandrill SMTP服務發送電子郵件。以下代碼執行但不發送任何電子郵件。當我嘗試使用System.Net.Mail.SmtpClient使用相同的憑據時,它可以工作併發送電子郵件。Serilog電子郵件水槽
EmailConnectionInfo info = new EmailConnectionInfo()
{
EmailSubject = "Email subject",
FromEmail = "[email protected]",
MailServer = "smtp.mandrillapp.com",
NetworkCredentials = new NetworkCredential("mandrill_username", "mandrill_apikey"),
Port = 587,
ToEmail = "[email protected]"
};
Log.Logger = new LoggerConfiguration()
.WriteTo.Email(info)
.CreateLogger();
Log.Error("Houston we have a problem");