如何避免google邮件服务器要求我通过浏览器登录? [英] How can I avoid google mail server asking me to log in via browser?
本文介绍了如何避免google邮件服务器要求我通过浏览器登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Google Apps配置的电子邮件从Django发送电子邮件,我在 settings.py
文件中的配置如下所示:
I am trying to send emails from Django using an email configured by Google Apps, my configuration at the settings.py
file looks something like this:
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'contact@mydomain.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
当我尝试发送电子邮件使用:
When I try to send an email using:
from django.core.mail import send_mail
send_mail("Happy new year", "We wish you the best for 3001",
"contact@mydomain.com", ["someuser@gmail.com"])
我收到以下错误:
SMTPAuthenticationError:
(535, '5.7.1 Please log in with your web browser and then try again.
Learn more at
5.7.1 https://support.google.com/mail/bin/answer.py?answer=78754 k2sm758604obl.14')
由于我正在使用远程没有图形用户界面,我甚至不能尝试从浏览器登录。
Since I'm working on a remote server with no graphical user interface, I cannot even try to login from the browser.
推荐答案
只需goto:
< a href =https://accounts.google.com/DisplayUnlockCaptcha =noreferrer> https://accounts.google.com/DisplayUnlockCaptcha
,然后单击继续,以允许从其他服务器访问。
and click continue this going to allow access from other servers.
这篇关于如何避免google邮件服务器要求我通过浏览器登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文