You will think about Magento SMTP Email Setup for custom SMTP credential when you meet the problem with your customer complain about spam box. It is not easy to have a hosting/server where you host your site and their IP is clean and trust enough to send to Inbox of your customers. With ecommerce website, it ‘s important to make your customers trust your service so I will show you how to solve this problem easy.

Basically, we have 2 options to use custom SMTP in magento:

1. Customize magento coding

This way, you can make sure your site performance is still fast without any extension installation.

Let ‘s do these steps:

– Copy file app/code/core/Mage/core/Model/Email/Template.php to your local folder

– Edit the getMail() function like this

public function getMail()
{
if (is_null($this->_mail)) {
$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' => 'email@domain.com',
'password' => 'yourpassword' );
$transport = new Zend_Mail_Transport_Smtp($my_smtp_host, $config);
Zend_Mail::setDefaultTransport($transport);
$this->_mail = new Zend_Mail('utf-8');
}
return $this->_mail;
}

You just need to edit the code to use your SMTP credential then you can enjoy the new functionality.

2. Install and configure magento SMTP extension

This is a easiest way for all of us, you just need to install one of these extension

http://www.magentocommerce.com/magento-connect/smtp-pro-email-free-custom-smtp-email.html

http://www.magentocommerce.com/magento-connect/advanced-smtp-artson-it.html

Just need to remember to logout and login again after you install these extension then I believe you know how to configure it.

20 thoughts on “Magento SMTP Email Setup

  1. That ‘s the perfect help, thanks for the tips, it save me a lot of time to get my site send email pefectly. Great work!

    1. Thanks Philip, even though the extension make the site a little bit slower but it still is a safe way so we can install and remove easily. So that if you don’t know how to do the coding then I recommend you use extension. Other than, if you have the question, you can ask here about this topic (not send me contact email) so I can solve it here and other people can see their answer too.

      And please make sure that your contact and your feedback is always welcome in our blog.

      Thanks again
      David

  2. That ‘s really nice help. It can be easy with many people but at least it help me very much. It almost spend 2 days research but I can’t solve this problem until I see you post. Thanks guy

  3. hi, i have the same problems, i installed SMTP Pro Email for extension then logout and login again, all the things i had to try but it didn’t work by that, that’s so annoying me for this moment. please help and let me know how to fix it.

      1. I’m using Magento ver. 1.9.1.0, and i just also try to install another Advanced Smtp – ArtsOn.IT still doesn’t work.

        1. It will not work when you install the package through magento connect if you’re running magento 1.9.1. But if you download the files manually, ignore the upload instructions and just upload the entire file structure to your magento root folder, it works like a charm!

  4. Hi,
    Please mention if it must overwrite the template.php file, after insert the code, or copy “in your local” ; where is the local ?
    I tried to install the extention, but i received a error, so i want to apply the manual metod.
    I’m using 1.9.1 version.

    Thank you very much,
    George,

Leave a Reply