发送邮件.py 317 B

1234567891011121314151617
  1. # -*- coding: UTF-8 -*-
  2. import yagmail
  3. yag = yagmail.SMTP(
  4. user='xclouds@qq.com',
  5. host='smtp.qq.com',
  6. password='899',
  7. port='25',
  8. smtp_ssl=False)
  9. yag.send(
  10. to='470234147@qq.com',
  11. subject='from xdc',
  12. contents='didi!')
  13. # 邮件正文
  14. # attachments= ['/root/1.jpg'] # 添加附件