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' => '',
'password' => 'yourpassword' );
$transport = new Zend_Mail_Transport_Smtp($my_smtp_host, $config);
$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

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

24 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

  2. Jesica, I meet the same problem like you and just logout and clear cache then everything will work well.

  3. Cool, it ‘s amazing to see it too simple like that. Thanks man a lot for sharing this smtp tip for magento. Keep doing well

  4. 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

  5. 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., 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!

          1. How do you download the files manually? I don’t see an option other than using Magento Connect.

  6. 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,

  7. i am using magento and Aschroder Smtppro extension in my site.issue with contact us form submit throws an error like “Unable to submit your request. Please, try again later” and i checked in exception log its shows an exception ‘Zend_Mail_Protocol_Exception’ with message ‘Connection timed out’ in /home/silvergal/public_html/lib/Zend/Mail/Protocol/Abstract.php:277.
    is above solution correct for this issue?
    please please help on this

    1. I have the same problem, the code caused a syntax error.
      Parse error: syntax error, unexpected ‘@’, expecting ‘)’ in /home/waterbab/public_html/app/code/core/Mage/Core/Model/Email/Template.php on line 112

      Anyone else tried opt 1 and got it to work?

  8. I also tried opt 1 and the code did not work. It caused a syntax error:

    Parse error: syntax error, unexpected ‘@’, expecting ‘)’ in /home/public_html/app/code/core/Mage/Core/Model/Email/Template.php on line 112

    Apparently it doesn’t want the @ in the email address, anyone else tried opt 1 and got it to work?

Comments are closed.