Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

server send emails using gmail smtp gets alerts

Tags:

php

smtp

gmail

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?

like image 384
Yichaoz Avatar asked Jul 04 '13 05:07

Yichaoz


People also ask

Can I use Gmail SMTP server for sending mail?

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.

How does SMTP work for Gmail?

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.

Does Gmail allow SMTP relay?

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 ...


1 Answers

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

like image 142
Yichaoz Avatar answered Oct 12 '22 11:10

Yichaoz