📜  轻松发送电子邮件 python 代码示例

📅  最后修改于: 2022-03-11 14:47:16.983000             🧑  作者: Mango

代码示例2
import smtplib

my_email = "testingemail@gmail.com"
password = "mypw123"

connection = smtplib.SMTP("smtp.gmail.com",587)
connection.starttls()
connection.login(user=my_email, password=password)
connection.sendmail(from_addr=my_email,to_addrs="receipentemail@yahoo.com", msg="Hello World")
connection.close()