I enrolled in a Python online course from this morning. I can't understand immediately after entering the paid content.
"Send Gmail in Python"
e? ?? Can't you do that?
But I can't.
from email import message import smtplib smtp_host = 'smtp.gmail.com' smtp_port = 587 from_email ='sender's address' to_email ='address of the person you want to send' username ='your address' password ='password' msg = message.EmailMessage() msg.set_content('test mail') msg['Subject'] = 'test mail(sub)' msg['From'] = from_email msg['To'] = to_email server = smtplib.SMTP(smtp_host, smtp_port) server.ehlo() server.starttls() server.ehlo() server.login(username, password) server.send_message(msg) server.quit()
I want to post the error text, but I can't because I don't know which one is personal information ... p=WantAuthError I'm curious about this written at the end, but it doesn't appear even if I search ... I wonder why. .. .. .. If you know, please give me some advice! !! !! !!
never give up
Recommended Posts