이메일을 보내기위한 간단한 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