!! python でメールの送信 PRG-PY-email を参照すること #!/usr/bin/env python3 # -*- coding: utf-8 -*- import smtplib from email.mime.text import MIMEText from email.header import Header from email.utils import formatdate from_address = 'senders@address' to_address = 'recived@add.ress' charset = 'ISO-2022-JP' subject = u'メールの件名です' text = u'メールの本文です' msg = MIMEText(text.encode(charset), 'plain', charset) msg['Subject'] = Header(subject, charset) msg['From'] = from_address msg['To'] = to_address msg['Date'] = formatdate(localtime=True) smtp = smtplib.SMTP('192.168.11.200') smtp.sendmail(from_address, to_address, msg.as_string()) smtp.close() ! Tips *https://www.python.ambitious-engineer.com/archives/2034