title: Magento - How enable SMTP server authentication and secure transport?
body: <p>I'd like to make the SMTP server working on Magento app(version 1.7). so I added the following code on file <code>app/code/core/Mage/Core/Model/Email/Template.php</code> </p>
  
  <pre><code>public function getMail()
      {
          if (is_null($this-&gt;_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' =&gt; 'tls',
                      'port' =&gt; $my_smtp_port,
                      'auth' =&gt; 'login',
                      'username' =&gt; 'account@gmail.com',
                      'password' =&gt; 'secret'
              );
  
              $transport = new Zend_Mail_Transport_Smtp($my_smtp_host, $config);
  
              Zend_Mail::setDefaultTransport($transport);
              /*End of added code to specify config*/
  
              $this-&gt;_mail = new Zend_Mail('utf-8');
          }
          return $this-&gt;_mail;
      }
  </code></pre>
  
  <p>Then on <strong>Admin Panel->System->Configuration->Advanced->System->Mail sending settings</strong></p>
  
  <p>The following settings have been added</p>
  
  <ul>
  <li>Host:  smtp.gmail.com </li>
  <li>Port(25): 587</li>
  </ul>
  
  <p>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).</p>
  
  <p>Hope anyone can help me. Really appreciate,Thanks!</p>