python_异步任务
作者:互联网
一、异步任务
实例:
1 import yagmail,threading 2 def send_mail(): 3 smtp = yagmail.SMTP(host='smtp.163.com',user='xmb@163.com', 4 password='fsdfsf') 5 smtp.send(to = '1064393@qq.com',cc=['xmb@163.com','3468242@qq.com'], 6 subject='标题',contents='正文',attachments=r'写日志.py') 7 8 def async_send_mail(): #启动一个线程专门发邮件 9 t = threading.Thread(target=send_mail) 10 t.start()
标签:异步,python,smtp,send,任务,xmb,mail,yagmail,com 来源: https://www.cnblogs.com/xumb/p/11964124.html