/** * @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 { parent::send($this->_message); } catch (\Exception $e) { throw new \Magento\Framework\Exception\MailException(new \Magento\Framework\Phrase($e->getMessage()), $e); } }
public function _sendMail() { $log = $this->_mail->getLog(); $log->setHeaders($this->_mail->getHeaders()); $log->setRaw($this->header . $this->EOL . $this->body); $this->_dispatchEvent(); $log->save(); if (Mage::getStoreConfigFlag(self::XML_PATH_ENABLE_PASSTHRU)) { parent::_sendMail(); } }
public function _sendMail() { $from = $this->_mail->getFrom(); if (!empty($from)) { $params = sprintf('-f%s', $from); $this->parameters = $params; if (!ini_get('safe_mode')) { $old_from = ini_get('sendmail_from'); ini_set('sendmail_from', $from); } } else { throw new \Gems_Exception('No sender email set!'); } parent::_sendMail(); if (isset($old_from)) { ini_set('sendmail_from', $old_from); } }
/** * 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; }