python: 发送邮件

来源:互联网 发布:上古卷轴5低配优化 编辑:程序博客网 时间:2024/04/27 05:04

示例:

>>> import smtplib>>> server = smtplib.SMTP('smtpav.csdn.com')>>> server.login ('fromuser','password')>>> server.sendmail('fromuser@csdn.com', 'touser@csdn.com','From:fromuser@csdn.com\r\nTo:touser@csdn.com\r\nSubject:this is a email from python demo\r\n\r\nJust for test~_~')

发送格式或者如python示例 

>>> server.sendmail('soothsayer@example.org', 'jcaesar@example.org',    """To: jcaesar@example.org    From: soothsayer@example.org    Beware the Ides of March.    """)

 

原创粉丝点击