Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SendGrid Cc and Bcc not working on PHP

Tags:

I'm using sendgrid with php, I've used both options the client library and the curl option. So far, I've been able to send emails directly with the addTo option with no problem. But when I try to add Cc or Bcc options, the email still gets sent but the copies are never delivered. Are there any known issues with the php version? In other project the java library works just fine.

Here is a simple piece of code I'm trying to make it work

<?php
require ('sendgrid/sendgrid-php.php');

$sendgrid = new SendGrid('user', 'pwd');

$mail = new SendGrid\Email();
$mail ->addTo("[email protected]");
$mail ->addCc("[email protected]");
$mail ->setFrom("[email protected]");
$mail ->setSubject("TEST");
$mail->setHtml("<h1>Example</h1>");
$sendgrid->send($mail);

?>