For myself, I actually prefer “unbiased” external tools, such as Wireshark, in order to see what is really happening. SmtpClienthas a trace - it sends the output to the trace System.Net, but this does not include the data actually passing through the wire. You can get this, of course, using tracing System.Net.Socketsby setting up your application like this:
<system.diagnostics>
<sources>
<source name="System.Net">
<listeners>
<add name="TraceFile"/>
</listeners>
</source>
<source name="System.Net.Sockets">
<listeners>
<add name="TraceFile"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add
name="TraceFile"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="trace.log"
/>
</sharedListeners>
<switches>
<add name="System.Net" value="Verbose"/>
<add name="System.Net.Sockets" value="Verbose"/>
</switches>
<trace autoflush="true" />
</system.diagnostics>
But, unfortunately, the output that this result gives is an unprocessed socket dump, which is much less convenient than Wireshark tracing.
, , , - SmtpClient , .