While trying to send an e-mail using MailKit and MimeKit,is there a way to collect the SMTP Output?.
ps: I am trying to migrate my email code from Easymail to Mimekit and Mailkit and I apologize if this is a rather basic query.
There's actually a FAQ about this, but for convenience, I'll paste it here:
All of MailKit's client implementations have a constructor that takes a nifty IProtocolLogger interface for logging client/server communications. Out of the box, you can use the handy ProtocolLogger class. Here are some examples of how to use it:
// log to a file called 'smtp.log'
var client = new SmtpClient (new ProtocolLogger ("smtp.log"));
// log to standard output (i.e. the console)
var client = new SmtpClient (new ProtocolLogger (Console.OpenStandardOutput ()));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With