Email not being sent

Discussion in 'Email' started by ginger, Jun 29, 2015.

  1. Hi There,

    I receive the following error when trying to send an email from the server:

    The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.

    I do not have this issue when I try the code from my local machine. Below is the code. Please provide assistance as we need the website running soon so really need this working. Thank you.

    protected void Submit_Click(object sender, EventArgs e)
    {
    MailMessage mail = new MailMessage();
    mail.To.Add(new MailAddress(txtTo.Text));
    mail.From = new MailAddress("[email protected]");
    mail.Priority = MailPriority.High;
    mail.Subject = "Thank you for registering with Zawjeen";

    SmtpClient smtp = new SmtpClient();
    smtp.Host = "smtp.gmail.com";
    smtp.Port = 587;
    smtp.EnableSsl = true;
    smtp.Credentials = new NetworkCredential("[email protected]", "zzz");
    smtp.Send(mail);
    }
     
  2. FredC

    FredC Winhost Staff

    ginger likes this.
  3. Thanks so much - that's exactly what it was, password strength!
     
    Elshadriel likes this.

Share This Page