python smtp gmail authentication error (sending email through gmail smtp server)
问题 I have the following code import smtplib from email.mime.text import MIMEText smtpserver = 'smtp.gmail.com' AUTHREQUIRED = 1 # if you need to use SMTP AUTH set to 1 smtpuser = 'admin@myhost.com' # for SMTP AUTH, set SMTP username here smtppass = '123456' # for SMTP AUTH, set SMTP password here RECIPIENTS = ['online8@gmail.com'] SENDER = 'admin@myhost.com' msg = MIMEText('dsdsdsdsds\n') msg['Subject'] = 'The contents of iii' msg['From'] = 'admin@myhost.com' msg['To'] = ''online8@gmail.com''