私は単純なsendgrid PHPスクリプトを使用して電子メールを送信しますが、ここで問題となるのは受信者を追加する必要があるためです。有益な情報を見つけて、受信者やメールを追加するためにここでどのように変更する必要があるのかを知っている人はいますか?Sendgrid php複数の受信者に送信
function sendEmail($subject, $to, $message) {
$from = new SendGrid\Email(null, "[email protected]");
$subject = $subject;
$to = new SendGrid\Email(null, $to);
$content = new SendGrid\Content("text/html", $message);
$mail = new SendGrid\Mail($from, $subject, $to, $content);
$apiKey = 'MY_KEY';
$sg = new \SendGrid($apiKey);
$response = $sg->client->mail()->send()->post($mail);
echo $response->statusCode();
}
は、メールアドレスごとに関数を呼び出します。 – muttonUp
コードサンプルお願いしますか? –
本当ですか?アドレスをループして関数を呼び出します。 – muttonUp