2016-07-27 104 views
1

我嘗試使用API​​請求 POST https://api.sendgrid.com/v3/mail/send HTTP/1.1發送包含「cc」和「bcc」的電子郵件。cc和bcc不能用於嘗試使用Web_API_v3發送郵件

我使用的數據部分是這樣

--data '{"personalizations": [{"to": [{"email": "[email protected]"}]},{"cc": [{"email": "[email protected]"}]},{"bcc": [{"email": "[email protected]"}]}],"from": {"email": "[email protected]"},"subject": "Hello, World!","content": [{"type": "text/plain", "value": "Heya!"}]}'

+0

這屬於sendgrid支持不是stackoverflow – Sikorski

回答

0

您的JSON是不是該用例正確了這樣的錯誤

{"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"}]}

。在「to」對象之後關閉個性化對象時,它應包含ccbcc對象。

Here's an example

{ 
    "personalizations": [{ 
     "to": [{ 
      "email": "[email protected]" 
     }], 
     "cc": [{ 
      "email": "[email protected]" 
     }], 
     "bcc": [{ 
      "email": "[email protected]" 
     }] 
    }] 
} 

你可以把subject在個性化,以及,但不fromcontent-type

相關問題