Python/Email
外观
< Python
Python可以发送MIME兼容的email。
import smtplib
from email.mime.text import MIMEText
msg = MIMEText(
"""Hi there,
This is a test email message.
Greetings""")
me = 'sender@example.com'
you = 'receiver@example.com'
msg['Subject'] = 'Hello!'
msg['From'] = me
msg['To'] = you
s = smtplib.SMTP()
s.connect()
s.sendmail(me, [you], msg.as_string())
s.quit()