【发布时间】:2016-07-27 13:15:22
【问题描述】:
我正在尝试使用 API 请求发送带有“cc”和“bcc”的电子邮件
POST https://api.sendgrid.com/v3/mail/send HTTP/1.1.
我遇到了这样的错误
{"errors":[{"message":"The to array is required for all personalization objects, and must have at least one email object with a valid email address.","field":"personalizations.1.to","help":"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.personalizations.to"},{"message":"The to array is required for all personalization objects, and must have at least one email object with a valid email address.","field":"personalizations.2.to"}]}
像这样使用数据部分
--data '{"personalizations": [{"to": [{"email": "example@email.com"}]},{"cc": [{"email": "example@email.com"}]},{"bcc": [{"email": "example@email.com"}]}],"from": {"email": "example@email.com"},"subject": "Hello, World!","content": [{"type": "text/plain", "value": "Heya!"}]}'
【问题讨论】:
-
这个属于sendgrid支持而不是stackoverflow