Closed cryo75 closed 1 year ago
A few questions/things to check:
SelfLog
to expose any internal errors that might be occurring? (https://github.com/serilog/serilog/wiki/Debugging-and-Diagnostics#selflog)Exception while emitting periodic batch from Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink: System.MissingMethodException: Method not found: 'System.Threading.Tasks.Task MailKit.MailTransport.SendAsync(MimeKit.MimeMessage, System.Threading.CancellationToken, MailKit.ITransferProgress)'. at Serilog.Sinks.Email.MailKitEmailTransport.SendMailAsync(EmailMessage emailMessage) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Serilog.Sinks.Email.MailKitEmailTransport.SendMailAsync(EmailMessage emailMessage) at Serilog.Sinks.Email.EmailSink.EmitBatchAsync(IEnumerable`1 events) at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick()
This seems to be an issue with the version of MailKit that this sink uses - I believe this is the same issue as #106 and #107, so I'll close this one out and suggest you subscribe to notifications for #106 and #107.
In the meantime, something to try is explicitly bringing in MailKit to your project (instead of as a transitive dependency via this sink), and trying an older version. This person had success with 2.15. Hope that helps!
I have a NET7 WebApi project and I'm using the latest prerelease package (2.4.1-dev-00147). I configured the
appsettings.json
as follows:And also created this extension:
But no email is being sent. Am I missing something?