python发送邮件的代码
#coding:utf-8
__author__ = 'Intgrp'
pwd='********'
import smtplib
from email.mime.text import MIMEText
from email.header import Header
print "正在发送"
smtpserver = 'smtp.163.com'
user = 'aaaaaaaa@163.com'
password = pwd
sender = '<span style="font-family: Arial, Helvetica, sans-serif;">aaaaaaaa</span><span style="font-family: Arial, Helvetica, sans-serif;">@163.com'</span>
receiver = '123456789@qq.com'
subject = 'Python test email'
#发送的内容
msg = MIMEText('点击链接直接进入阿里天池:<a href="https://tianchi.aliyun.com/" >https://tianchi.aliyun.com/</a>','html','utf-8')
msg['Subject'] = Header(subject, 'utf-8')
smtp = smtplib.SMTP()
smtp.connect(smtpserver)
smtp.login(user, password)
smtp.sendmail(sender, receiver, msg.as_string())
smtp.quit()
print "成功发送"