How can I use a local SMTP server when developing on Windows 7?

JoeLangley picture JoeLangley · Jul 13, 2009 · Viewed 95k times · Source

How can I get SMTP to work on a Windows 7 development box? I used to just be able to turn on the IIS SMTP server on Windows XP. Is SMTP not included with Windows 7? If so, what can I use instead as a free relay mechanism?

Answer

SpazDude picture SpazDude · Apr 29, 2010

If you are developing in ASP.net using the built-in mail libraries, a lesser-known configuration setting is to use the following:

<configuration>
. . . more config stuff here . . .     
  <system.net>
    <mailSettings>
      <smtp deliveryMethod="SpecifiedPickupDirectory" from="[email protected]">
        <specifiedPickupDirectory pickupDirectoryLocation="c:\smtp\"/>
      </smtp>
    </mailSettings>
  </system.net>
</configuration>

All your application generated emails will be dumped into this directory during development. No smtp server needed!