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.
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
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.
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]
I realized that google is updating/checking for my MX records for my domain. Perhaps this is the problem. Thanks for all your help.
With Google I believe there SMTP server is setup to listen to a secured line. You may need to set "EnableSsl" to true.