You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
535 B

#!/usr/bin/env python3
#coding: utf-8
import smtplib
from email.mime.text import MIMEText
sender = '44444444444444444444g'
receiver = '44444444444444444rg'
subject = 'python email test'
smtpserver = '4444444444444444444rg'
username = '4444444444444444g'
password = '44444444444444444444444'
msg = MIMEText('<html><h1>ja2磁盘使用超过80%</h1></html>','html','utf-8')
msg['Subject'] = subject
smtp = smtplib.SMTP()
smtp.connect(smtpserver)
smtp.login(username, password)
smtp.sendmail(sender, receiver, msg.as_string())
smtp.quit()