Myluzh Blog

Strive to become a dream architect.

Python邮件发送例子

2023-10-25 myluzh Python

python邮件发送案例 import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText class AutoEmail: def __init__(self): self.__sender_email = "support@itho.cn" self.__password = "qwer1234" def send_email(self, recipient_emails, subject, message): msg = MIMEMultipart() msg['Subject'] = subject msg['From'] = self.__sender_email # 检查recipient_emails是否是一个字符串。如果是字符串,则将其转换为包含单个收件人的列表 if isinstance(r...

阅读全文>>

标签: python email 邮件发送

评论(0) (140)