erp = $erp; } /** * @param string $senderEmail * @param string[] $recipientEmails * @param string $mailSubject * @param string $mailContent * * @throws EmailAccountNotFoundException * @throws EmailNotSentException */ public function send(string $senderEmail, array $recipientEmails, string $mailSubject, string $mailContent): void { foreach ($recipientEmails as $email) { $isSent = $this->erp->MailSend( $this->erp->GetFirmaMail(), $senderEmail, $email, '', $mailSubject, $mailContent, "", "" ); if (!$isSent) { throw new EmailNotSentException('Mail could not be sent. More info in the logger'); } } } }