如何避免谷歌邮件服务器要求我通过浏览器登录? [英] How can I avoid google mail server asking me to log in via browser?

查看:83
本文介绍了如何避免谷歌邮件服务器要求我通过浏览器登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 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.

推荐答案

只需转到https://accounts.google.com/DisplayUnlockCaptcha并点击继续".这将允许从其他服务器访问.

Just go to https://accounts.google.com/DisplayUnlockCaptcha and click "continue". This is going to allow access from other servers.

这篇关于如何避免谷歌邮件服务器要求我通过浏览器登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆