我正在尝试使用Serilog.Sinks.Email NuGet包(v1.5.0.0)和Mandrill SMTP服务发送电子邮件。以下代码执行但不发送任何电子邮件。当我尝试使用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");