public function send($recipients) { if (!empty($recipients)) { $this->emailObj->setTo($recipients); $numberOfEmailsSent = $this->emailObj->send(); if ($numberOfEmailsSent) { return TRUE; } } return FALSE; }
/** * * Sends a mail with a certain subject and bodytext to a recipient in form of a * frontend user. * * @param \TYPO3\CMS\Extbase\Domain\Model\FrontendUser $recipient * The recipient of the mail. This is a plain * frontend user. * @param string $subject The mail's subject * @param string $bodyText The mail's bodytext * * @return void * */ public function sendMail(\TYPO3\CMS\Extbase\Domain\Model\FrontendUser $recipient, $subject, $bodyText) { if ($recipient->getEmail()) { $mail = new \TYPO3\CMS\Core\Mail\MailMessage(); $mail->setTo(array($recipient->getEmail()))->setFrom($this->getDefaultSenderAddress(), $this->getDefaultSenderName())->setSubject($subject)->setBody($bodyText)->send(); } }