python发邮件

#!/usr/bin/env python
# -*- coding:utf-8 -*-

a="18265068511@163.com"
b="公司"
c="abc009"      #pop3要开启

d="702628045@qq.com"
e="xiao被"

f="招聘"
g="您好,您已经被录取"

def you_xiang(a,b,c,d,e,f,g):
  import smtplib
  from email.mime.text import MIMEText
  from email.utils import formataddr

  msg = MIMEText(g, 'plain', 'utf-8')
  msg['From'] = formataddr([b,a])
  msg['To'] = formataddr([e,d])
  msg['Subject'] = f
  server = smtplib.SMTP("smtp.163.com", 25)
  server.login(a, c)
  server.sendmail(a, [d,], msg.as_string())
  server.quit()

you_xiang(a,b,c,d,e,f,g)

  

posted @ 2018-01-11 14:44  一只宅男的自我修养  阅读(149)  评论(0编辑  收藏  举报