Can't send CC'd emails with the PHP XML-SDK

I’m trying to send an email through the XML API but the CC’d addresses don’t receive anything, only the main address - which, to be clear, receives the message even with the API responding false. Are there any other hidden requirements for this to work properly?

Here’s sample code:

$contact = [18216];
$sender = "myself@mycompany.com";
$receiver = "~Contact.Email~";
$cc = "boss+1@mycompany.com,boss+3@mycompany.com,myself+test@mycompany.com";
$bcc = "";
$type = "HTML";
$subject = "[IFS] Test email";
$body = "......"; //removed for brevity
$result = $ifs_client->emails()->sendEmail($contact, $sender, $receiver, $cc, $bcc, $type, $subject, $body, "");
var_dump($result); //false, but the email arrives for the main contact

I also tried including all CC addresses on the main toAddress parameter, but it seems the API only cares for the merge field and doesn’t even send the message to the additional addresses.

Hey @igor.santos,
If I remember correctly the ccAddresses here are only for syncing (record keeping) and are not actually sent. However, if you have an array of contacts as your first argument, an email should be sent to each of them.

1 Like