Python 官方文档:入门教程 => 点击学习
#!/usr/bin/pythonimport smtplibimport stringHOST = "mail.merit-link.com"SUBJECT = "Test email from Python"TO = "yaosx@me
#!/usr/bin/python
import smtplib
import string
HOST = "mail.merit-link.com"
SUBJECT = "Test email from Python"
TO = "yaosx@merit-link.com"
FROM = "yaosx@merit-link.com"
text = "Python 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.login("yaosx","mypasswd") #注意此处是登录的用户名和密码
server.sendmail(FROM,[TO],BODY)
server.quit()
--结束END--
本文标题: python 2.6.6 smtplib
本文链接: https://lsjlt.com/news/186487.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0