""" author:少校 create Time:2025/2/24 15:20 越努力越幸运 """ name = input("请输入您的名字:") gender = input("请输入性别(男/女):") account = input("请输入您的邮箱地址:") from email.mime.image import MIMEImage from smtplib import SMTP_SSL from email.mime.multipart import MIMEMultipart #邮件类 from email.header import Header #邮件主题 from email.mime.text import MIMEText #正文类 connect = SMTP_SSL("smtp.qq.com","465") connect.login("85444652@qq.com","eueysxwzzfncbhab") mail = MIMEMultipart() mail["subject"] = Header("网上订票系统","utf-8").encode() mail["to"] = account mail["from"] = "12306<85444652@qq.com>" html_data = open("files/12306.html","r",encoding="utf-8").read() send_data = html_data % (name,gender) text = MIMEText(send_data,"html","utf-8") mail.attach(text) connect.sendmail("85444652@qq.com",account,mail.as_string()) connect.quit()
05.动态控制邮件内容
本节851字2025-02-24 17:34:48