标签:fas 抽屉 request smtp smtplib mail from 服务商 ring
import smtplib from email.mime.text import MIMEText from email.utils import formataddr def email(email_list, content, subject="抽屉新热榜-用户注册"): msg = MIMEText(content, ‘plain‘, ‘utf-8‘) msg[‘From‘] = formataddr(["抽屉新热榜",‘wptawy@126.com‘]) msg[‘Subject‘] = subject # SMTP服务- server = smtplib.SMTP("smtp.126.com", 25) #url 端口 server.login("wptawy@126.com", "JUEmimima") server.sendmail(‘wptawy@126.com‘, email_list, msg.as_string()) server.quit() # email([‘xiaohu@live.com‘,‘jinxin@live.com‘], ‘xiaohuzuishuai‘)
发送短信微信:从服务商处购买url,用如http://www.fasong.com?...&...&...
也可用requests模块 import requests
标签:fas 抽屉 request smtp smtplib mail from 服务商 ring
原文地址:https://www.cnblogs.com/lbzbky/p/11625327.html