title: The SMTP server requires a secure connection or the client was not authenticated. if uploading on godaddy
body: <p><strong>below code is working fine in local, but if upload upload it on godaddy it is not working.</strong></p>
  
  <p>Error: showing</p>
  
  <blockquote>
    <p>The SMTP server requires a secure connection or the client was not
    authenticated. The server response was: 5.5.1 Authentication Required.
    Learn more at</p>
  </blockquote>
  
  <pre><code>Line 53:        
  Line 54:         smtp.EnableSsl = true;
  Line 55:         smtp.Send(message);
  Line 56: 
  Line 57: 
  </code></pre>
  
  <p><strong>plz check below code</strong></p>
  
  <pre><code>    MailMessage message = new MailMessage();
      message.From = new MailAddress(emailid.Text);
  
      message.To.Add(new MailAddress("receiver@gmail.com"));
  
      message.Subject = "NaatKhawan's Feedback";
  
      message.Body = "Selected: " + DropDownList1.Text.ToString() + "&lt;br/&gt;&lt;br/&gt;Name: " + name.Text.ToString() + " &lt;br/&gt;&lt;br/&gt;Email: " + emailid.Text.ToString() + " &lt;br/&gt;&lt;br/&gt;Contact Number: " + phone.Text.ToString() + " &lt;br/&gt;&lt;br/&gt;Message:&lt;br/&gt; " + remabox.Text.ToString();
  
      message.IsBodyHtml = true;
  
      // finaly send the email:
      SmtpClient smtp = new SmtpClient();
      smtp.Host = "smtp.gmail.com";
  
      smtp.Port = 587;
      smtp.Credentials = new System.Net.NetworkCredential("123@gmail.com", "123");
  
      smtp.EnableSsl = true;
      smtp.Send(message);
      lbltxt.Visible = true;
      name.Text = "";
      emailid.Text = "";
      phone.Text = "";
      remabox.Text = "";
  
      lbltxt.Text = "Thank you for supporting NaatKhawan";
  </code></pre>