System The SMTP server requires a secure connection or the client was not authenticat

Discussion in 'Email' started by xavito, May 19, 2011.

  1. I get this error when trying to send e-mails with my web app.

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

    Help will be appreciated.
     
  2. Elshadriel

    Elshadriel Winhost Staff

    Could you post sample code?
     
  3. Here is the code...

    objClient = New System.Net.Mail.SmtpClient("smtp.gmail.com", 587)
    objClient.EnableSsl = True
    objClient.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
    objClient.Timeout = 20000



    objCredentials = New System.Net.NetworkCredential("[email protected]", "**********")
    objClient.Credentials = objCredentials
    objClient.UseDefaultCredentials = True

    objAddressFrom = New System.Net.Mail.MailAddress(strSender)

    objMessage.Priority = intPriority
    objMessage.From = objAddressFrom
    objMessage.Subject = strSubject
    objMessage.Body = objPage.PageLayoutEmailPublic(sb.ToString)
    objMessage.IsBodyHtml = True
     
  4. Elshadriel

    Elshadriel Winhost Staff

    If you're going to send email out through Gmail's SMTP server, you should authenticate by using a gmail account. [email protected] will not work.
     
  5. I have setup my domain to use google apps and have set cname and mx records.

    I can send and receive e-mails using the web inter-phase for gmail with the account [email protected]
     
  6. I realized that google is updating/checking for my MX records for my domain. Perhaps this is the problem.

    Thanks for all your help.
     
  7. Ray

    Ray

    With Google I believe there SMTP server is setup to listen to a secured line. You may need to set "EnableSsl" to true.
     

Share This Page