Mailjet : Send Cc or Bcc mail with Mailjet Send API

Viewed 1031

I'm using Mailjet Send API.

I can send emails by using this part ofcode :

$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"];

But if I want to add a Cc or Bcc, like :

 $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"
        ]
      ]
    ];

then it does not work anymore. However the documentation seems to stipulate it's the right way : here

Any idea how to solve this ?

Many thanks.

0 Answers
Related