标签:smtplib
#!/usr/bin/python # -*- coding: utf-8 -*- import smtplib import string HOST = "smtp.uinx.com.cn" SUBJECT = "Test email from Python" #TO = "yafeng.jin@archermind.com" #TO = "desheng.shi@archermind.com" TO = "yunxing.le@archermind.com" FROM = "smurf@uinx.com.cn" text = "Pyhon rules them all!" BODY = string.join(( "From: %s" %FROM, "To: %s" % TO, "Subject: %s" % SUBJECT, " ", text ),"\r\n") server = smtplib.SMTP() server.connect (HOST,"25") #server.starttls() server.login("smurf@uinx.com.cn","ddddd@") server.sendmail(FROM, [TO], BODY) server.quit
本文出自 “Smurf Linux运维” 博客,请务必保留此出处http://jin771998569.blog.51cto.com/2147853/1615922
标签:smtplib
原文地址:http://jin771998569.blog.51cto.com/2147853/1615922