任何人都请帮忙,我正在起诉sendgrid v3 api。但是我找不到任何将电子邮件发送给多个收件人的方法。预先感谢。
import sendgrid
from sendgrid.helpers.mail import *
sg = sendgrid.SendGridAPIClient(apikey="SG.xxxxxxxx")
from_email = Email("FROM EMAIL ADDRESS")
to_email = Email("TO EMAIL ADDRESS")
subject = "Sending with SendGrid is Fun"
content = Content("text/plain", "and easy to do anywhere, even with Python")
mail = Mail(from_email, subject, to_email, content)
response = sg.client.mail.send.post(request_body=mail.get())
print(response.status_code)
print(response.body)
print(response.headers)
Run Code Online (Sandbox Code Playgroud)
我想发送电子邮件给多个收件人。就像to_mail =“ xxx@gmail.com,yyy@gmail.com”。