I’m currently working on an MVC prototype where I want to compile and send an email from the form to a directory as an eml file vs using a physical SMTP server. While this is not critical the issue has now sparked my curiosity as to “why it’s not working”
Within my web.config file I have the following settings
<system.net>
<mailSettings>
<smtp deliveryMethod="SpecifiedPickupDirectory">
<network host="ignored"/>
<specifiedPickupDirectory pickupDirectoryLocation="c:\email" />
</smtp>
</mailSettings>
However within my web app whenever I invoke my sendmail method I am receiving an exception that the smtp host was not found. What I was expecting was that the smtpClient would generate the eml file localy. Or am I totally missing the point of SpecifiedPickupDirectory and I have to invoke a trip to a smtp server?
thanks in advance
The following works just great for me (I have no SMTP server installed locally):
In web.config put:
In the
Indexaction ofHomeControllerput:Run the application