0
votes

I have configured an smtp server over a IIS 6.0 in windows server 2008. I have already granted: -Administrators - NT AUTHORITY\LOCAL SERVICE - NT AUTHORITY\NETWORK SERVICE - IUSR_MACHINE_NAME - MY Domain User

The folder structure for the SMTP service is the following: - Badmail - Drop - Pickup - Queue

I have a mvc application that send emails via pickup directory, the configuration is the following:

<smtp deliveryMethod="SpecifiedPickupDirectory">
<specifiedPickupDirectory pickupDirectoryLocation="E:\Email\dev\Pickup" xdt:Transform="Replace"  />
</smtp>

the problem is when I set up the pickup directory the application never writes the email files to that specific folder, the odd thing is that I'm not getting any exception either, I guess this could be an issue related to some user permissions but I already have granted the full control to everyone in that folder as well.

The fact is that I'm not getting get any email.

this environment isn't for production, and is just for testing purposes, Any Advice?

1

1 Answers

0
votes

Try below code, this works for me, I have been using it in my project and when sending mail, the eml file gets created here.

  <system.net>
        <mailSettings>
          <!-- Method#2: Dump emails to a local directory -->
          <smtp from="[email protected]" deliveryMethod="SpecifiedPickupDirectory">
            <network host="localhost" />
            <specifiedPickupDirectory pickupDirectoryLocation="F:\Project\Mails\" />
          </smtp>
        </mailSettings>
      </system.net>