I'd like to make the SMTP server working on Magento app(version 1.7). so I added the following code on file app/code/core/Mage/Core/Model/Email/Template.php
public function getMail()
{
if (is_null($this->_mail)) {
/*Start of added code to specify config*/
$my_smtp_host = Mage::getStoreConfig('system/smtp/host');
$my_smtp_port = Mage::getStoreConfig('system/smtp/port');
$config = array(
'ssl' => 'tls',
'port' => $my_smtp_port,
'auth' => 'login',
'username' => '[email protected]',
'password' => 'secret'
);
$transport = new Zend_Mail_Transport_Smtp($my_smtp_host, $config);
Zend_Mail::setDefaultTransport($transport);
/*End of added code to specify config*/
$this->_mail = new Zend_Mail('utf-8');
}
return $this->_mail;
}
Then on Admin Panel->System->Configuration->Advanced->System->Mail sending settings
The following settings have been added
After completing these changes, I did test (i.e. Email to a Friend )on frontend. The success message was shown but the email wasn't in the mailbox(Not even in the spam).
Hope anyone can help me. Really appreciate,Thanks!
You should not hack into the core code, there are many reasons because this it NOT a good idea. One is: You aren't able to upgrade.
Instead use a extension or write your own: http://www.magentocommerce.com/magento-connect/ASchroder/extension/1865/aschroder.com-smtp-pro
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With