E.g., for troubleshooting I need to see what SMTP messages go back and forth:
OUT : EHLO machinename IN : 250-ReallyCoolEmailServer Hello [10.24.41.72] IN : 250-SIZE IN : 250-PIPELINING IN : (...and so on...) OUT : MAIL FROM: <some.address@example.com> IN : 250 <some.address@example.com>... Sender ok
...and so on.
I'm not finding any logging options in the documentation. The only questions here I can find about SmtpClient
either don't talk about seeing the actual conversattion, or talk about using third party tools like WireShark.
It seems like a pretty big omission, so I'm guessing I'm just missing something fundamental. :-)
An example of what the socket dump looks like:
source: http://www.systemnetmail.com/faq/4.10.aspx
For myself, I actually prefer "unbiased" external tools like Wireshark for seeing what's actually going over the line.
SmtpClient
does have tracing -- it sends output to theSystem.Net
trace -- but this does not include the data actually going over the wire. You can obtain that, of course, using theSystem.Net.Sockets
trace, by configuring your application like so:But unfortunately, the output this yields is a raw socket dump that's much less convenient than a Wireshark trace.
So in the end, no, you're not missing anything --
SmtpClient
does not have tracing on the protocol level, and this is indeed a pretty big omission.