The personal ramblings of Jon Carlos mobile & web developer and technology enthusiast.

Sunday, 29 January 2012

Asp.net MailSettings with no SMTP server

19:56 Posted by Jon Carlos , 1 comment
I was doing some Umbraco v5 testing this weekend and Lee and Sabastiaan were working on a simple contact form. The contact form required MailSettings setup on the machine I was working on.

I don't run an SMTP server or Virtual SMTP server and could not really be bothered to as I just wanted to get everything up and running so i did a bit of Googleing and I found that you can deposit emails to a folder on your computer for sending later.

So I got emails setup in about 30 seconds by using this in my web.config

<mailsettings>
<smtp deliverymethod="SpecifiedPickupDirectory" from="email@domain.com">
<network host="ignored">
<specifiedpickupdirectory pickupdirectorylocation="C:\email">
</specifiedpickupdirectory></network></smtp>
</mailsettings>

Awesome!

1 comments:

Sebastiaan Janssen said...

Nifty little trick huh? Don't forget to give modify rights on that folder for the app pool user (I typically use the IIS_USRS group).