System.Net.Mail.SmtpException: Cannot get IIS pickup directory
-
11-10-2019 - |
سؤال
Fellas,
Getting the "Cannot get IIS pickup directory" exception with my app. I have my directory created and specified in the config as follows:
<system.net>
<mailSettings>
<smtp deliveryMethod="PickupDirectoryFromIis" from="donotreply@mysite.com">
<specifiedPickupDirectory pickupDirectoryLocation="C:\inetpub\email\mysite"/>
</smtp>
</mailSettings>
</system.net>
Trying to have the emails placed locally in a directory so I can see them.
Any ideas why it could be throwing that exception?
FWIW, this is IIS7 + Windows 7 and an MVC2 app (C#).
Also, went ahead and gave permissions to the IIS_IUSRS group to that directory.
المحلول
All,
Seems like I was using the wrong smtp deliveryMethod. I got the PickupDirectoryFromIis and SpecifiedPickup deliveryMethod's mixed up, and hence was using the wrong settings for it.
لا تنتمي إلى StackOverflow