1 import yamail
 2
 5 
 6 user='xxx@qq.com'
 7 password='ekocciewnagdbaib' #如果是163、qq、126邮箱,这里的密码不是登录的密码,是授权码
 8 host = 'smtp.qq.com'
 9 mail = yamail.SMTP(host=host,user=user,password=password)
10 mail.send(
11     to=['xxx@qq.com'],
12     cc=['xxx@qq.com'],
13     subject='中午多吃饭',
14     contents='吃饭睡觉打豆豆!!1',
15     attachments=['复习.py']
16           )
17 mail.close()

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
  • 2021-06-02
  • 2022-01-11
  • 2021-07-25
猜你喜欢
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2021-12-22
  • 2022-01-30
  • 2021-10-11
相关资源
相似解决方案