📜  smtp 电子邮件模板 - Python 代码示例

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

代码示例1
with smtplib.SMTP('smtp.gmail.com', 587) as connection:
    connection.starttls()  # tls = transport layer security (securing our connection)
    connection.login(user=my_email, password=password)
    connection.sendmail(
        from_addr=my_email,
        to_addrs=reciever_mail,
        msg=f"Subject:Your subject goes here\n\nyour message goes here and \nthis will be on new line"
    )