10

Here is related topic similar to my problem & the answer is correct :

gmail-error-the-smtp-server-requires-a-secure-connection-or-the-client-was-not

And here is related site :

send-email-from-gmail-with-smtp-authentication-but-got-5_5_1-authentication-required-error

I used c# to send mail & my code is correct & works on local & old host.
The problem is about new host that i don't have REMOTE access.
In the new host i got this email from google :
google mail
I clicked on Check activity & click it was me.
But problem still exists.
I don't have remote access to the new host & i do n't want give my password to them.
Here is the error from new host :

sending email was failed, SmtpException -> Error : System.Net.Mail.SmtpException: 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 at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at Virtual_Visa_Cards.WebForm4.Send_Email_Gmail(String display_name, String from, String to, String subject, String html_body, String sender_email, String sender_password)

What is the solution & how can i add new host ip as trusted in gmail account?(Please conside on my edits)

Edit :
1. I do n't want to enable two factor authentication
2. Low secure apps is On
3.

But what if you don't have access to the production server. try the solution 3

solution 3 for case 3: You have to enable login from other timezone / ip for your google account.

to do this follow the link https://g.co/allowaccess and allow access by clicking the continue button.

And that's it. Here you go. Now you will be able to login from any of the computer and by any means of app to your google account.

When i use the link in solution 3 email can be send for 1-5 times.
After that error appears again & i should use the link again.

SilverLight
  • 19,668
  • 65
  • 192
  • 300
  • 1
    Thanks! For me after allowing access via this link https://g.co/allowaccess it finally worked & the email was sent successfully. – Sanushi Salgado Mar 27 '21 at 05:17

0 Answers0