4

When I send mail from local it works pretty well, but when I deploy on azure it fails.

Error: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required. Learn more at

enter image description here

Saba Shavidze
  • 604
  • 4
  • 14

1 Answers1

1

This generally happens when you try login from different time zone or IP Address Computer. Your production server and the mail id you have used both are in different time zone. Choose either of these two solutions:

  • Log in to production server via remote access, and sign in to gmail once with your credentials. They will ask for the confirmation, confirm it and log out. (If you are using a VM)

    OR

  • log in gmail to your local computer, Follow this Link and choose review this activity and take proper actions.

Check out this SO question to know more (additionally you can verify Roshan Parmar's points from this): https://stackoverflow.com/questions/20906077/gmail-error-the-smtp-server-requires-a-secure-connection-or-the-client-was-not#:~:text=solution%20for%20case%201%3A%20Enter,to%20login%20from%20all%20apps.&text=Use%20that%20newly%20generated%20password%20to%20authenticate%20via%20SMTP.

Harshita Singh
  • 4,590
  • 1
  • 10
  • 13