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);
?>
The documentation does not seem to have addCc method. You can try these alternatives.
$mail = new SendGrid\Email();
$mail->addTo('[email protected]')->
addTo('[email protected]')->
addTo('[email protected]');
or
$mail = new SendGrid\Email();
$mail->addBcc('[email protected]');
$sendgrid->send($mail);