, SmtpClient, .
Write your own SMTP implementation (it’s very simple) that writes messages that are sent through it to disk, rather than sending them via email.
Then
var client = new SmtpClient("address.of.your.smtp.implementation");
client.Send(mailMessage);
Your server will now intercept this send request and write it to disk.
jason source
share