title: ASP.NET send email through 1and1 smtp
body: <p>I am having issues sending an email through 1and1 smtp </p>
  
  <p>Here is my code that i use in my asp.net mvc application: 
  (When I used this code with gmail it works fine, but now I have to use 1and1 and it won't work :(  </p>
  
  <pre><code>public void Send(Inquiry inquiry)
      {
          SmtpClient smtpClient = new SmtpClient ("Smtp.1and1.com", 587);
          smtpClient.UseDefaultCredentials = false;
          smtpClient.Credentials = new System.Net.NetworkCredential("mail@mywebsite.com", "mypassword");
  
          smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
          smtpClient.EnableSsl = true;
          MailMessage mail = new MailMessage();
  
  
          mail.From = new MailAddress("sales@mywebsite.com", "myname");
          mail.To.Add(new MailAddress("sales@mywebsite.com"));
          mail.Subject = $"New inquiry from {inquiry.Name}";
          mail.Body = $"{inquiry.Message}\r " +
              $"Recieved: {inquiry.Date}";
          mail.ReplyToList.Add(new MailAddress(inquiry.Email));
  
  
          smtpClient.Send(mail);
      }
  </code></pre>
  
  <p>The error that I get is:</p>
  
  <pre><code>SmtpException: Error in processing. The server response was: Requested action aborted: local error in processing
  </code></pre>
  
  <p>System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, string response)</p>