""" author:少校 create Time:2025/2/24 16:47 越努力越幸运 """ from smtplib import SMTP_SSL from email.mime.multipart import MIMEMultipart # 邮件类 from email.header import Header # 邮件主题 from email.mime.text import MIMEText # 正文类 from time import sleep #休眠等待 user_info = { '余婷': '726550822@qq.com', '余婷1': 'y_t209@163.com', '侯宝山': '85444652@qq.com', '王楠': '275345555@qq.com', '裴宇': '2731427616@qq.com', '黄琪昊': '1326168409@qq.com', '刘海凤': '1737780343@qq.com', '李健欣': '1536873173@qq.com', '崔梦珂': '1596649945@qq.com', '龙刚': '253466184@qq.com', '景林峰': '1063765532@qq.com' } for name in user_info: account = user_info[name] connect = SMTP_SSL('smtp.qq.com', "465") connect.login('85444652@qq.com', 'eueysxwzzfncbhab') mail = MIMEMultipart() mail["subject"] = Header("XX活动","utf-8").encode() mail["to"] = account mail["from"] = "XXwebsite<85444652@qq.com>" text = MIMEText(f"你好,{name}.","plain","utf-8") mail.attach(text) connect.sendmail("85444652@qq.com",account,mail.as_string()) print(f"{name}发送成功") connect.quit() sleep(5)
06.批量发布邮件
本节1336字2025-02-24 17:35:19