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
>
I have managed to send Forgot Password Email from localhost.
Only thing you need to do is follow the steps listed below and your done.
app/code/core/Mage/Core/Model/Email/Template.php
Comment the existing functionality and add the below code
public function getMail()
{
if (is_null($this->_mail)) {
/* changes begin */
$my_smtp_host = Mage::getStoreConfig('system/smtp/host');
$my_smtp_port = Mage::getStoreConfig('system/smtp/port');
$config = array(
'port' => $my_smtp_port,
'auth' => 'login',
'username' => 'your username',
'password' => 'your password'
);
$transport = new Zend_Mail_Transport_Smtp($my_smtp_host, $config);
Zend_Mail::setDefaultTransport($transport);
/* Changes End */
$this->_mail = new Zend_Mail('utf-8');
}
return $this->_mail;
}
Login to admin System -> Configuration -> Advanced -> System -> Mail Sending settings
and set the following things.
Disable Email Communications = No
Host = smtp.mandrillapp.com
Port (25) = 587
Set Return-Path = No
Login to admin System -> Transactional Emails -> Add New Template
follow these steps
In Load default template - select the required template like 'Forgot Password'
and click on the Load Template
a default template will be be populated in the template content
In Template Information - Provide any template name like Forgot Password
and click on save template.
Login to admin System -> Configuration -> Customers -> Customer Configuration -> Password Options
In Forgot Email Template
select 'Forgot Password' (which was created in
Transactional Emails tab) from the drop down.
Select Remind Email Template
to 'Forgot Password'
Select Forgot and Remind Email Sender
to any drop down value for ex -
customer support.
Note - Make Sure the customer support is set to some valid email address. In order modify the customer support email - Login to admin System -> Configuration -> General -> Store email Address -> Customer support
add the valid email address.
That's all your done. Please feel free to post your queries. For more info refer this http://pravams.com/2011/07/30/magento-send-email-using-smtp/