/** * Sends the actual mail and handles autorespond message * * @return boolean */ public function sendTheMail() { // Sending the mail requires the recipient and message to be set. if (!$this->mailMessage->getTo() || !trim($this->mailMessage->getBody())) { return FALSE; } $this->mailMessage->send(); // Auto response if ($this->autoRespondMessage) { $theParts = explode('/', $this->autoRespondMessage, 2); $theParts[0] = str_replace('###SUBJECT###', $this->subject, $theParts[0]); $theParts[1] = str_replace("/", LF, $theParts[1]); $theParts[1] = str_replace("###MESSAGE###", $this->plainContent, $theParts[1]); /** @var $autoRespondMail t3lib_mail_Message */ $autoRespondMail = t3lib_div::makeInstance('t3lib_mail_Message'); $autoRespondMail->setTo($this->fromAddress)->setSubject($theParts[0])->setFrom($this->recipient)->setBody($theParts[1]); $autoRespondMail->send(); } return $this->mailMessage->isSent(); }
/** * Sends a Swift e-mail. * * @param t3lib_mail_Message $email the e-mail to send. * * @return void */ protected function sendSwiftMail(t3lib_mail_Message $email) { $email->send(); }