title: Relay access denied 5.7.1
body: <p>I've got the error "Relay access denied", but I can connect my account with some email programs.</p>
  
  <p>My code:</p>
  
  <pre><code>        SmtpClient smtpClient = new SmtpClient();
          NetworkCredential basicCredential =
              new NetworkCredential("xx@xx.com", "xxx");
          MailMessage message = new MailMessage();
          MailAddress fromAddress = new MailAddress("xx@xx.com");
  
          smtpClient.Host = "mail.xx.com";
          smtpClient.Port = 587;
          smtpClient.UseDefaultCredentials = false;
          smtpClient.Credentials = basicCredential;
  
          message.From = fromAddress;
          message.Subject = subject;
          message.IsBodyHtml = true;
          message.Body = body;
          message.To.Add("aa@aa.com");
  
          try    
          {
              smtpClient.Send(message);
          }
          catch (Exception ex)
          {
              //Relay access denied...
          }
  </code></pre>
  
  <p>Does anyone know the reason for this?</p>