Thursday, January 10, 2008

Check that your .NET App Email Delivery is Working Without SMTP Running

Testing code that sends email has always been a pain. You had to set up a SMTP service just to test that your .NET application sends the e-mail correctly and in our office, this is a big no-no for developers. The admins are very conscious about having rogue SMTP servers running for fear of relaying.

.NET allows you to tell your application to drop e-mails into a specified folder instead of sending them via SMTP server using the following code in your web.config.

<system.net>

<mailSettings>

<smtp deliveryMethod="SpecifiedPickupDirectory">

<specifiedPickupDirectory pickupDirectoryLocation="c:\Test\" />

<smtp>

<mailSettings>

<system.net>

And viola... a .eml file is deposited into the specified directory.

1 comment:

  1. Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my site, it is about the CresceNet, I hope you enjoy. The address is http://www.provedorcrescenet.com . A hug.

    ReplyDelete