📜  发送电子邮件 - Python 代码示例

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

代码示例1
from redmail import EmailSender
from pathlib import Path

# Configure an email sender
email = EmailSender(
    host="", port=0,
    user_name="me@example.com", password=""
)

# Send an email
email.send(
    sender="me@example.com",
    receivers=["you@example.com"],
    subject="An example email"
    attachments={
        "myfile.txt": Path("path/to/a_file.txt"),
        "myfile.html": "

Content of a HTML attachment

" } )