imaplib.error: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)

刘超 16天前 ⋅ 114 阅读   编辑

一、描述

  python 2.7 imaplib访问google邮箱,有如下提示

>>> imapserver='imap.gmail.com'
>>> imapport='993'
>>> import smtplib,imaplib
>>> M = imaplib.IMAP4_SSL(imapserver,imapport)
>>> username=""
>>> password=""
>>> M.login(username,password)
Traceback (most recent call last):
  File "", line 1, in
  File "/usr/lib/python2.7/imaplib.py", line 519, in login
    raise self.error(dat[-1])
imaplib.error: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)

二、解决方法

  重新授权应用密码(具体见这里


注意:本文归作者所有,未经作者允许,不得转载

全部评论: 0

    我有话说: