title: SmtpException: Cannot get IIS pickup directory
body: <p>I am trying to send email from my mvc application. Following is a part of the code I am using:</p>
  
  <pre><code>SmtpClient smtpClient = new SmtpClient();
  smtpClient.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
  smtpClient.UseDefaultCredentials = true;
  smtpClient.Send(message);
  </code></pre>
  
  <p>The above code is giving the error:</p>
  
  <blockquote>
    <p>Cannot get IIS pickup directory SmtpException.</p>
  </blockquote>
  
  <p>But if I run my Visual Studio as an Administrator, emails are sent successfully.</p>
  
  <p>If I understand correctly, the issue is regarding access permissions, but I just can't figure out what.
  If Relevant, the application is an intranet application with windows authentication.</p>