Send mails to local folder

Just learned this today at work, you can configure .NET to send emails to a local folder.

<configuration>
  <system.net>
    <mailSettings>
      <smtp deliveryMethod="specifiedPickupDirectory">
        <specifiedPickupDirectory
          pickupDirectoryLocation="c:\maildrop"
        />
      </smtp>
    </mailSettings>
  </system.net>
</configuration>

From https://msdn.microsoft.com/en-us/library/ms164241(v=vs.110).aspx

Super useful on your development machine, where you most likely don’t actually want to send out mails but do want to view them during development.

Theme music for this blog post

Advertisements
Send mails to local folder

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s