我正在使用 Mailjet Send API。
我可以使用这部分代码发送电子邮件:
$body = [
'Messages' => [
[
'From' => [
'Email' => "$fromm",
'Name' => "$namee"
],
'To' => [
[
'Email' => "$to",
'Name' => ""
]
]
'Subject' => "$subject",
'TextPart' => "$text",
'HTMLPart' => "$confirmationMail",
'CustomID' => "AppGettingStartedTest"
]
]
];
$response = $mj->post(Resources::$Email, ['body' => $body]);
$response->success();
$success=$response->getData()["Messages"][0]["Status"];
但是如果我想添加抄送或密件抄送,例如:
$body = [
'Messages' => [
[
'From' => [
'Email' => "$fromm",
'Name' => "$namee"
],
'To' => [
[
'Email' => "$to",
'Name' => ""
]
],
'Cc' => [
[
'Email' => "$cc",
'Name' => ""
]
],
'Bcc' => [
[
'Email' => "$cci",
'Name' => ""
]
],
'Subject' => "$subject",
'TextPart' => "$text",
'HTMLPart' => "$confirmationMail",
'CustomID' => "AppGettingStartedTest"
]
]
];
然后它就不再起作用了。然而,文档似乎规定这是正确的方法:here
知道如何解决这个问题吗?
非常感谢。