Skip to main content
All CollectionsEmail Problems
Configure email with Magento SMTP server
Configure email with Magento SMTP server
Antonio avatar
Written by Antonio
Updated over a year ago

Dear customer,
To modify the SMTP email sending in Magento, you must access the following file:
app/code/core/Mage/Core/Model/Email/Template.php
And modify the getMail() function to look like this:

public function getMail()    {        if (is_null($this->_mail)) {            $my_smtp_host = Mage::getStoreConfig('system/smtp/host');            $config = array(                'port' => '587',                'auth' => 'login',                'username' => 'YourEmail',                'password' => 'YourEmailPassword');            $transport = new Zend_Mail_Transport_Smtp($my_smtp_host, $config);            Zend_Mail::setDefaultTransport($transport);            $this->_mail = new Zend_Mail('utf-8');        }        return $this->_mail;    }
Did this answer your question?