Whenever I add "addCC" to the code below. I always receive an error which is "Notice: Array to String Conversion", but when I remove "addCC", the code works.
The error appears to be line 51 in lib/SendGrid.php which is: curl_setopt($ch, CURLOPT_POSTFIELDS, $form);
$sendgrid_email->addTo($receiver_email)->
addCC("[email protected]", "[email protected]")->
setFrom($sender_email)->
setFromName("Email Sender")->
setSubject($subject)->
setHtml($email_content)->
addHeader("X-Sent-Using", "SendGrid-API")->
addHeader("X-Transport", "web");
Is there any fix for this error?
The code is written in PHP
Maybe it is a deserialization issue?
@mbernier Not sure, I haven't found the cause of the problem yet. If ever the error is in deserialization, what would be the fix for this?
@rsalunga29 I think the problem is in addCc method. You try to add multiple CC but method expected only one. You should use addCcs method instead.
@misantron that what I did :). Thanks for your input!
Most helpful comment
@rsalunga29 I think the problem is in addCc method. You try to add multiple CC but method expected only one. You should use addCcs method instead.