IIS localhost System.Net.Mail.SmtpFailedRecipientsException Unable to relay for

If you do development on your localhost and you want to test email, you can update your web.config as per below.  Note that you will need a directory of D:\Maildrop on your machine.  Doing this will result in emaills being delivered to the directory you specify.

You may receive Unable to relay for... errors and if you do, you can specify a from in the smtp element.

 <mailSettings> <smtp deliveryMethod="SpecifiedPickupDirectory" from="local@localhost">

<specifiedPickupDirectory pickupDirectoryLocation="D:\Maildrop"/> </smtp></mailSettings>