setSubject($subject) ->setFrom($this->helper->mail->getMailSenderAddress(), $authorName) ->setTo(array($recipientEmail => $recipientName)); $headers = $message->getHeaders(); // See https://tools.ietf.org/html/rfc3834#section-5 $headers->addTextHeader('Auto-Submitted', 'auto-generated'); if (! empty($authorEmail)) { $message->setReplyTo($authorEmail); } $message->setBody($html, 'text/html'); Swift_Mailer::newInstance($this->getTransport())->send($message); } catch (Swift_TransportException $e) { $this->logger->error($e->getMessage()); } } /** * Get SwiftMailer transport * * @access protected * @return \Swift_Transport */ protected function getTransport() { return Swift_MailTransport::newInstance(); } }