当前位置: 首页 > 图文教程 > 脚本技术 > Python > Python httplib,smtplib使用方法
import httplib
conn=httplib.HTTPConnection("www.cnblogs.com")
conn.request("GET", "/coderzh/archive/2008/05/13/1194445.html")
r=conn.getresponse()
print r.read() #获取所有内容
import smtplib
smtpServer = 'smtp.xxx.com'
fromaddr = '[email protected]'
toaddrs = '[email protected]'
msg = 'Subject: xxxxxxxxx'
server = smtplib.SMTP(smtpServer)
server.sendmail(fromaddr, toaddrs, msg)
server.quit( )
评论 (0) All