我正试图使用发送网格作为php的电子邮件平台,但问题是我无法将多封电子邮件作为CC标头发送,也无法编辑FROM标头以在电子邮件地址前显示Name。
$from = "News Letter <new@gmail.com>" // cannot get the "News Letter" to Display
$cc = array("aaaaaa@gmail.com","bbbbb@gmail.com");// doesnt send to arrays
$params = array(
'api_user' => $user,
'api_key' => $pass,
'to' => $to,
'cc' => $cc,
'subject' => $subject,
'html' => $body,
'from' => $headers
);
您需要在$params数组中使用一些附加字段,如下所示:
$params = array(
'api_user' => $user,
'api_key' => $pass,
'to' => $to,
'toname' => 'Newsletter Person',
'cc' => $cc,
'subject' => $subject,
'html' => $body,
'from' => $headers,
'fromname' => 'Newsletter'
);
直接通过邮件发送。发送端点不允许在CC字段中使用数组,但如果您使用SendGrid PHP库,则可以使用和数组进行CC