通过Python代码来发送邮件。下面是步骤
-  先在某一个邮箱页面 
  
-  开启 POP3/SMTP服务 
  
-  获取授权码,这样免密码登录 
 授权码会用在代码里
  
-  获得 SMTP 服务器地址 

- 代码
import smtplib 
from email.mime.text import MIMEText 
from email.utils import formataddr msg = MIMEText("写邮件内容", "html", "utf-8") 
msg['Subject'] = "写邮件主题"  
msg["From"] = formataddr(["name", "写自己邮箱地址"])  # 自己名字,自己邮箱
msg["to"] = "对方邮箱地址"  # 对方邮箱server = smtplib.SMTP_SSL("SMTP服务器地址")  # 从第四步获取到
server.login("写自己邮箱地址", "从第三步获取授权码")
server.sendmail("自己邮箱地址", "自己邮箱地址", msg.as_string())
server.quit()- 对方就能收到来自 Python代码发送的邮件了。
点个赞呗~