title: PHP SwiftMailer Failed to authenticate on SMTP server
body: <p>I am trying to create a test site that handles paypal payment. I am trying to send users an email using PHP SwiftMailer after a successful payment (which is my IPN).</p>
  
  <p>Here is my code for the transport:</p>
  
  <pre><code>        $transport = Swift_SmtpTransport::newInstance('smtp.googlemail.com', 465, 'ssl')
            -&gt;setUsername('xxx@xxx.co.uk')
            -&gt;setPassword('xxxx');    
  
      $mailer = Swift_Mailer::newInstance($transport);
  </code></pre>
  
  <p>I have tried to use googlemail and another email which is hosted under a shared server and both have problems giving out an error.  </p>
  
  <p>Unfortunately, I am getting this usual error:</p>
  
  <pre><code>  Fatal error: Uncaught exception 'Swift_TransportException' with message 'Failed to authenticate on SMTP server with username "xxx@xxx.co.uk" using 2 possible authenticators' in /home/xxx/public_html/paypal/lib/classes/Swift/Transport/Esmtp/AuthHandler.php:184 
  
    Stack trace: 
  
    #0 /home/xxx/public_html/paypal/lib/classes/Swift/Transport/EsmtpTransport.php(312): Swift_Transport_Esmtp_AuthHandler-&gt;afterEhlo(Object(Swift_SmtpTransport)) 
  
    #1 /home/xxx/public_html/paypal/lib/classes/Swift/Transport/AbstractSmtpTransport.php(120): Swift_Transport_EsmtpTransport-&gt;_doHeloCommand() 
  
    #2 /home/xxx/public_html/paypal/lib/classes/Swift/Mailer.php(80): Swift_Transport_AbstractSmtpTransport-&gt;start() 
  
    #3 /home/xxx/public_html/paypal/ipn.php(113): Swift_Mailer-&gt;send(Object(Swift_Message)) 
  
    #4 /home/mctikudo/public_html/paypal/ipn.php(46): sendMail(Resource id #3, Array) 
  
    #5 {main} thrown in /home/xxx/public_html/paypal/lib/classes/Swift/Transport/Esmtp/AuthHandler.php on line 184
  </code></pre>
  
  <p>I have done some research and tried several approach in the setting of my transport. But still nothing seems to work. Until I just tried to place my IPN code to another server under another hosting company and surprisingly, it works. Same code from the other one.</p>
  
  <p>This is why I guess there is something in the other server must be set or something.</p>
  
  <p>Are there things that I need to make sure that is enabled on my server to have the SwiftMailer work?</p>