内容简介:的方法,但是我遇到了第1步的问题,通过imap访问帐户.这里是我开始的代码:我收到以下错误:
的方法,但是我遇到了第1步的问题,通过imap访问帐户.
这里是我开始的代码:
import email
import imaplib
m = imaplib.IMAP4_SSL("imap.gmail.com",993)
rc, resp = m.login('myemailaddress','mypassword')
我收到以下错误:
Traceback (most recent call last):
File "email.py", line 1, in <module>
import email, imaplib
File "/home/will/wd/email.py", line 14, in <module>
m.login('myemailaddress','mypassword')
File "/usr/lib/python3.4/imaplib.py", line 538, in login
raise self.error(dat[-1])
imaplib.error: b'[ALERT] Please log in via your web browser: http://support.google.com/mail/accounts/bin/answer.py?answer=78754 (Failure)'
确实在Gmail设置中启用了Imap.在类似的情况下,我已经看过关于谷歌支持链接的指导和关于这个错误的问题,比如 here 和 here ,但是我的情况与第一个不一样,因为1)从来没有开始,2)我是不经常运行它被阻止.它也不同于第二个例子,因为这是一个普通的Gmail帐户,而不是具有Google Apps帐户的自定义域.使用 https://accounts.google.com/DisplayUnlockCaptcha 尝试并允许访问也不适用于我.
允许登录工作的唯一方法是将我的Google帐户安全设置更改为“允许访问较不安全的应用”.
我的问题是:如何修复我的代码(或我的设置更一般),以允许我登录,而不放松我的帐户安全设置?有没有办法使用libimap来满足安全要求?
以上所述就是小编给大家介绍的《gmail登录失败使用python和imaplib》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:- 解决登录Harbor Registry时鉴权失败的问题
- 等保测评主机安全:CentOS密码修改周期与登录失败处理
- LaravelWeb v1.2.0 旗舰版发布,解决登录过期Token解析失败卡死的问题
- 快速失败机制 & 失败安全机制
- 通过不断地失败来避免失败,携程混沌工程实践
- 快速失败(fail-fast)和安全失败(fail-safe)
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
The Smashing Book
Jacob Gube、Dmitry Fadeev、Chris Spooner、Darius A Monsef IV、Alessandro Cattaneo、Steven Snell、David Leggett、Andrew Maier、Kayla Knight、Yves Peters、René Schmidt、Smashing Magazine editorial team、Vitaly Friedman、Sven Lennartz / 2009 / $ 29.90 / € 23.90
The Smashing Book is a printed book about best practices in modern Web design. The book shares technical tips and best practices on coding, usability and optimization and explores how to create succes......一起来看看 《The Smashing Book》 这本书的介绍吧!