📅  最后修改于: 2022-03-11 14:46:31.876000             🧑  作者: Mango
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import *
message = Mail(
from_email='sender@example.com',
to_emails=[To('test@example.com'), To('test2@example.com')],
subject='Subject line',
text_content='This is the message of your email',
)
sg = SendGridAPIClient(SENDGRID_API_KEY)
response = sg.send(message)