email - Serilog 电子邮件接收器

标签 email mandrill serilog

我正在尝试使用 Serilog.Sinks.Email NuGet 包 (v1.5.0.0) 和 Mandrill SMTP 服务发送电子邮件。以下代码执行但不发送任何电子邮件。当我尝试使用 System.Net.Mail.SmtpClient 使用相同的凭据时,它可以正常工作并发送电子邮件。

EmailConnectionInfo info = new EmailConnectionInfo()
{
    EmailSubject = "Email subject",
    FromEmail = "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1c7a6e73715c7b717d7570327f7371" rel="noreferrer noopener nofollow">[email protected]</a>",
    MailServer = "smtp.mandrillapp.com",
    NetworkCredentials = new NetworkCredential("mandrill_username", "mandrill_apikey"),
    Port = 587,
    ToEmail = "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e1958ea1868c80888dcf828e8c" rel="noreferrer noopener nofollow">[email protected]</a>"
};

Log.Logger = new LoggerConfiguration()
    .WriteTo.Email(info)
    .CreateLogger();

Log.Error("Houston we have a problem");

最佳答案

正如您所发现的,这是电子邮件接收器最新版本中的一个错误,您慷慨提供的拉取请求已修复该错误。版本1.5.13现在在 NuGet 上的接收器的版本包含修复程序。

关于email - Serilog 电子邮件接收器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29437985/

相关文章:

css - 将 CSS 放在山魈模板中的什么位置

email - Google Schema 是否支持 quoted-printable 编码?

email - 用于 JavaMail 测试的邮件服务器

linux - 为什么 mailx 忽略标题字段?

java - 如何在 Mandrill 模板中使用 ParseObject 发送动态内容电子邮件?

c# - 如何使用 Serilog 在异步方法上保持一致的标识符

Serilog - 在 AppSettings 中配置多个接收器

c# - 使用 Serilog 仅将此信息记录到另一个文件

email - Gmail 应用 (Android) 上的响应式电子邮件

email - 测试电子邮件功能的好方法