今日は朝からPythonのオンライン講座に登録しました。
有料コンテンツに入ってすぐ理解不能。
「PythonでGmailを送る」
え??そんなんできんの?
でも私はできない。
from email import message
import smtplib
smtp_host = 'smtp.gmail.com'
smtp_port = 587
from_email = '送る人のアドレス'
to_email = '送りたい相手のアドレス'
username = '自分のアドレス'
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()
エラーの文章も載せたいけど、どれが個人情報かわからないので載せれません…
p=WantAuthError
最後に書かれているこれが気になるけど検索しても出てこない…
なんでかな。。。。
分かる方いましたらアドバイスお願いします!!!!
あきらめない