serilog / serilog-sinks-email

A Serilog sink that writes events to SMTP email
Apache License 2.0
70 stars 68 forks source link

.net45 version send mail after exception #62

Closed ste4net closed 6 months ago

ste4net commented 5 years ago

Why not use mailkit for both framework (core and .net45)?

Doing test sending mail (via sendgrid) i recive an exception even if the message is delivered.

2018-10-26T09:11:10.0409337Z Received failed result Error: System.Net.Mail.SmtpException:
Unauthenticated senders not allowe

It should be something wrong in authentication type that is correct in mailKit version because using the same configuration with .net Std versione there is no exceptions.

c.WriteTo.Email(fromEmail: "..@..",
                toEmail: "..@..",
                mailServer: "smtp.sendgrid.net",
                networkCredential: new System.Net.NetworkCredential("usr", "pwd"),
                mailSubject: "Error",
                restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Error);

Although it is not a SmtpClient issue because messages with same parameters are sent with no issue using a System.Net.Mail.SmtpClient too.

nblumhardt commented 6 months ago

Closing this one as stale; hope you were able to find a solution.