import smtplib
#from email.mime.text import MIMETextfrom email.MIMEText import MIMETextdef send_email(content):sender = ""
receiver = [] host = '220.181.12.16' port = 465 msg = MIMEText(content) msg['From'] = "" msg['To'] = "" msg['Subject'] = "backup check"try:
smtp = smtplib.SMTP() smtp.connect('220.181.12.16:25')# smtp.ehlo()# smtp.starttls()# smtp.ehlo()# smtp = smtplib.SMTP_SSL(host, port)
smtp.login(sender, 'xxxx') smtp.sendmail(sender, receiver, msg.as_string())# getlog().info("send email success") except Exception, e:# get_log().error(e) print 'email fail' print e passsend_email('aaa')