testing sending emails .NET
Friday, July 10th, 2009At first I thought this may be tricky but as it turns out I am not the only one ever to have this problem!
First of all you can try and use the SpecificPickupDirectory. This tells the smtp client to simply drop the message into a desegnated directory:
http://dotnettipoftheday.org/tips/smtp-delivery-method-SpecifiedPickupDirectory.aspx
<system.net>
<mailSettings>
<smtp deliveryMethod=”SpecifiedPickupDirectory”>
<specifiedPickupDirectory pickupDirectoryLocation=”c:\Test\” />
</smtp>
</mailSettings>
</system.net>
If that does not float your boat then you can take it a stage further:
http://haacked.com/archive/2006/05/30/ATestingMailServerForUnitTestingEmailFunctionality.aspx
Another useful tool is this: http://www.codeproject.com/KB/IP/despop3client.aspx