/**
  * @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 {
         parent::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 {
         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);
     }
 }
Beispiel #4
0
    /**
     * Sends this email using the given transport or a previously
     * set DefaultTransport or the internal mail function if no
     * default transport had been set.
     *
     * @param  Zend_Mail_Transport_Abstract $transport
     * @return Zend_Mail                    Provides fluent interface
     */
    public function send($transport = null)
    {
        if ($transport === null) {
            if (! self::$_defaultTransport instanceof Zend_Mail_Transport_Abstract) {
                require_once 'Zend/Mail/Transport/Sendmail.php';
                $transport = new Zend_Mail_Transport_Sendmail();
            } else {
                $transport = self::$_defaultTransport;
            }
        }
        require_once 'Zend/Mail/Transport/Sendmail.php';
        $transport = new Zend_Mail_Transport_Sendmail();

        if ($this->_date === null) {
            $this->setDate();
        }

        if(null === $this->_from && null !== self::getDefaultFrom()) {
            $this->setFromToDefaultFrom();
        }

        if(null === $this->_replyTo && null !== self::getDefaultReplyTo()) {
            $this->setReplyToFromDefault();
        }

        $transport->send($this);

        return $this;
    }