I'm using this to send an email to one recipient using SendGrid, but I need to send a different email to a different recipient on the same page. If I duplicate the code block, it emails both recipients the second email when the second code block runs.
$sendgrid = new SendGrid($sendgridapikey);
$emailmaster = new SendGrid\Email();
$emailmaster->addTo($to)
->setFrom('<email>')
->setFromName('<name>')
->setSubject($subject)
->setHtml($message);
$sendgrid->send($emailmaster);
Based on here explanation, you can send to multiple reception when you pass
$to
variable as array;for example;