I did something like this to make my web app sends mails through gmail's SMTP. I tried locally and it worked. after I upload to the server (which is in another country) I get this error:
authentication failure [SMTP: Invalid response code received from server (code: 534, response: 5.7.9 Please log in with your web browser and then try again. Learn more at 5.7.9 https://support.google.com/mail/bin/answer.py?answer=78754 5.7.9 {WEBLOGINREQUIRED} fl2sm1579003pab.23 - gsmtp)]
is there a way to ignore this?
Use the Gmail SMTP serverIf you connect using SSL or TLS, you can send mail to anyone inside or outside of your organization using smtp.gmail.com as your server. This option requires you to authenticate with your Gmail or Google Workspace account and passwords.
The Gmail SMTP server lets you send emails using your Gmail account and Google's servers. One option here is to configure third-party email clients, such as Thunderbird or Outlook, to send emails via your Gmail account. The default Gmail SMTP details are as follows: Gmail SMTP server address: smtp.gmail.com.
If your organization uses Microsoft Exchange or another SMTP service or server, you can set up the SMTP relay service to route outgoing mail through Google. You can use it to: Filter messages for spam and viruses before they reach external recipients. Apply email security and advanced Gmail settings to outgoing ...
For anyone still interest the answer:
Google have to allow your app to use your own account, to allow this google provided an easy way, just go to https://accounts.google.com/DisplayUnlockCaptcha, then click continue
, then with 10 min, use your application to try to send email again, and google will remember the application/service and allow your application to access your account as long as you don't change your password.
cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With