/**
  * Send a mail using this transport
  *
  * @return void
  * @throws \Magento\Framework\Exception\MailException
  */
 public function sendMessage()
 {
     try {
         parent::send($this->_message);
     } catch (\Exception $e) {
         throw new \Magento\Framework\Exception\MailException(new \Magento\Framework\Phrase($e->getMessage()), $e);
     }
 }
Esempio n. 2
0
 /**
  * Send a mail using this transport
  *
  * @return void
  * @throws \Magento\Framework\Exception\MailException
  */
 public function sendMessage()
 {
     try {
         parent::send($this->message);
     } catch (\Exception $e) {
         $phrase = new \Magento\Framework\Phrase($e->getMessage());
         throw new \Magento\Framework\Exception\MailException($phrase, $e);
     }
     return true;
 }
Esempio n. 3
0
 /**
  * @inheritdoc
  *
  * @throws \Conjoon_Mail_Exception if this transport was already used
  */
 public function send(\Zend_Mail $mail)
 {
     if ($this->isUsed) {
         /**
          * @see \Conjoon_Mail_Exception
          */
         require_once 'Conjoon/Mail/Exception.php';
         throw new \Conjoon_Mail_Exception("Transport was already used");
     }
     $this->isUsed = true;
     return parent::send($mail);
 }
 /**
  * @throws \Magento\Framework\Exception\MailException
  */
 public function sendMessage()
 {
     try {
         if ($this->helper->isEnabled()) {
             parent::send($this->message);
         } else {
             $this->sendMail->send($this->message);
         }
     } catch (\Exception $e) {
         throw new \Magento\Framework\Exception\MailException(__($e->getMessage()), $e);
     }
 }
 /**
  * Send a mail using this transport
  *
  * @return void
  * @throws \Magento\Framework\Exception\MailException
  */
 public function sendMessage()
 {
     try {
         if ($this->_helper->isEnabled()) {
             parent::send($this->_message);
         } else {
             $normal = new \Zend_Mail_Transport_Sendmail();
             $normal->send($this->_message);
         }
     } catch (\Exception $e) {
         throw new \Magento\Framework\Exception\MailException(new \Magento\Framework\Phrase($e->getMessage()), $e);
     }
 }
 /**
  * Send a mail using this transport
  *
  * @return void
  * @throws \Magento\Framework\Exception\MailException
  */
 public function sendMessage()
 {
     try {
         $attachments = $this->getMail()->getAttachments();
         /** @noinspection IsEmptyFunctionUsageInspection */
         if (!empty($attachments)) {
             foreach ($attachments as $attachment) {
                 $this->_message->addAttachment($attachment->toMimePart());
             }
         }
         $this->getMail()->setSent(false)->setSentAt($this->createSentAt())->setTransportId(uniqid($this->_message->getSubject(), true));
         parent::send($this->_message);
         $this->getMail()->setSent(true);
     } catch (\Exception $e) {
         throw new \Magento\Framework\Exception\MailException(new \Magento\Framework\Phrase($e->getMessage()), $e);
     }
 }