尝试使用SMTP登录Gmail帐户时,会出现以下错误消息:
SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted.
造成错误的代码:
import smtplib
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()
server.login("sending@gmail.com", "your_password")
message = "TEST"
server.sendmail("sending@gmail.com", "receiving@gmail.com", message)
server.quit()