Wednesday, March 4, 2009

Setting up SMTP on an asp.net development server.

This article outlines the steps necesssary to get the emails dropped into a directory on my development machine. It took me quite a while so here is the useful information.

Architecture
Visual Studio 2008
IIS 7
Windows 7

Step 1 - web.config Settings












Step 2 - Directory Permissions
Ensure that the location you set here:
pickupDirectoryLocation="c:\Temp\MailDrop\"

that the "Network Service" user has write access to.

Step 3 - Check code
Check your code is not overwriting these default permissions when creating the SMTP Object

Dim objSMTPServer As New Net.Mail.SmtpClient
objSMTPServer.Host = strSMTPServer objSMTPServer.Port = ConfigurationManager.AppSettings("SMTP_Port")
etcc..