Source for file Email.php
Documentation is available at Email.php
* This class wraps the Basic email sending functionality
* If SMTPPro is enabled it will send emails using the given
* @author Ashley Schroder (aschroder.com)
* @copyright Copyright (c) 2010 Ashley Schroder
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
// If it's not enabled, just return the parent result.
if (!Mage::helper('smtppro')->isEnabled()) {
Mage::log('SMTPPro is enabled, sending email in Aschroder_SMTPPro_Model_Email');
// The remainder of this function closely mirrors the parent
// method except for providing the SMTP auth details from the
// configuration. This is not good OO, but the parent class
// leaves little room for useful subclassing.
if (Mage::getStoreConfigFlag('system/smtp/disable')) {
$mail =
Mage::getModel('emailimages/mail');
$mail->setBodyHtml($this->getBody());
$mail->setBodyText($this->getBody());
$transport =
Mage::helper('smtppro')->getTransport();
$dev =
Mage::helper('smtppro')->getDevelopmentMode();
$email =
Mage::getStoreConfig('contacts/email/recipient_email');
Mage::log("Development mode set to send all emails to contact form recipient: " .
$email);
} elseif ($dev ==
"supress") {
Mage::log("Development mode set to supress all emails.");
# we bail out, but report success
// We just set the outgoing email as normal
$email =
$this->getToEmail();
$mail->setFrom($this->getFromEmail(), $this->getFromName())
->addTo($email, $this->getToName())
->setSubject($this->getSubject());
// If we are using store emails as reply-to's set the header
if (Mage::helper('smtppro')->isReplyToStoreEmail()) {
// Later versions of Zend have a method for this, and disallow direct header setting...
$mail->setReplyTo($this->getSenderEmail(), $this->getSenderName());
$mail->addHeader('Reply-To', $this->getSenderEmail());
Mage::log('ReplyToStoreEmail is enabled, just set Reply-To header: ' .
$this->getSenderEmail());
Mage::log('About to send email');
Mage::log('Finished sending email');
$body =
$this->getBody();
Mage::dispatchEvent('smtppro_email_after_send',
array('to' =>
$this->getToName(),
'subject' =>
$this->getSubject(),
'template' =>
"n/a", //TODO: is that true?
'html' =>
(strtolower($this->getType()) ==
'html'),
Documentation generated on Fri, 09 Oct 2015 03:37:10 +0200 by phpDocumentor 1.4.4