“Cannot get IIS pickup directory” error

Problem

You receive “Cannot get IIS pickup directory” error while trying to send email via System.Net.Mail namespace in ASP.NET.

Explanation

User account under which the ASP.NET code is being executed doesn’t have access to the SMTP configuration path in IIS metabase.

Solution

  1. Find out under what domain/user account your ASP.NET application is running
  2. Download MetaAcl tool from here
  3. Run the following command:cscript Metaacl.vbs “IIS://localhost/SMTPsvc” your_domain\your_username RE

The above steps will give your_domain\your_username Read & Enumerate permissions in IIS metabase on SMTPsvc branch.