title: Unable to send emails to external domain using SMTP
body: <p>I am not able to send emails to external domain addresses like 'user.one@asdf.com' using the code below. </p>
  
  <pre><code>SmtpClient smtpClient = new SmtpClient(smtpMailServer);
  smtpClient.UseDefaultCredentials = true;
  smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
  smtpClient.EnableSsl = true;
  
  //Sending mail.
  smtpClient.Send(mailMessage);
  </code></pre>
  
  <p>I get an exception - </p>
  
  <p><code>Mailbox unavailable. The server response was: 5.7.1 Unable to relay for xxx@example.com</code></p>
  
  <p>If I change the DeliveryMethod to -</p>
  
  <pre><code>smtpClient.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
  </code></pre>
  
  <p>I am able to send the emails on my local machine. But it fails on the production site with an exception - </p>
  
  <p><code>Cannot get IIS pickup directory</code></p>
  
  <p>Can you please suggest me what to do?</p>