public function setTo($to)
{
if ($to instanceof Email) {
$to = [$to];
}
foreach ($to as $email) {
if (!$email instanceof Email) {
throw new MailerException('Email must be an instance of \\Webiny\\Component\\Mailer\\Email.');
}
$this->addTo($email);
}
return $this;
}