zl程序教程

您现在的位置是:首页 >  后端

当前栏目

python 利用 smtplib发邮件详解编程语言

Python编程语言 详解 利用 发邮件 smtplib
2023-06-13 09:11:47 时间
content = "request build error" to_address = ["[email protected]"]
def send_email(username, passwd, recv, title, content, email_host="hwsmtp.exmail.qq.com", port=25): msg = MIMEText(content) msg["from"] = "menghui" msg["Subject"] = title smtp = smtplib.SMTP(host=email_host, port=port, timeout=120) smtp.login(username, passwd) smtp.set_debuglevel(1) smtp.sendmail(username, recv, msg.as_string()) smtp.quit()
def send(title, content, to_address): email_user = "[email protected]" email_pwd = "Mobvista123" send_email(email_user, email_pwd, to_address, title, content)

 

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/17084.html

cjava