title: Swift_TransportException Failed to authenticate on SMTP server with username "example@gmail.com" using 2 possible authenticators
body: <p>I am using yii2 mailer function and i am faced the issue the error is as below</p>
  
  <pre><code> Swift_TransportException
      Failed to authenticate on SMTP server with username "example@gmail.com" using 2 possible authenticators. Authenticator LOGIN returned Swift_TransportException: Expected response code 235 but got code "535", with message "535 Incorrect authentication data
  </code></pre>
  
  <p>here is my configuration for mailer</p>
  
  <pre><code>'mailer' =&gt; [
              'class' =&gt; 'yii\swiftmailer\Mailer',
              'viewPath' =&gt; '@common/mail',
  
              'transport' =&gt; [
                  'class' =&gt; 'Swift_SmtpTransport',
                  'host' =&gt; 'smtp.gmail.com',  // e.g. smtp.mandrillapp.com or smtp.gmail.com
                  'username' =&gt; 'example@gmail.com', //ses-smtp-user.20180221-103827  username: administrator
                  'password' =&gt; "example123#",
                  'port' =&gt; '587', // Port 25 is a very common port too 25, 465 or 587
                  'encryption' =&gt; 'tls', // It is often used, check your provider or mail server specs
                  'streamOptions' =&gt; [
                      'ssl' =&gt; [
                          'verify_peer' =&gt; false,
                          'verify_peer_name' =&gt; false,
  
                      ]
                  ],
              ],
              // send all mails to a file by default. You have to set
              // 'useFileTransport' to false and configure a transport
              // for the mailer to send real emails.
              'useFileTransport' =&gt; false,
          ],
  </code></pre>
  
  <p>if anyone knows what's the issue please let me know i am not getting where is the mistake thanks!</p>