1

I am using yii2 mailer function and i am faced the issue the error is as below

 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

here is my configuration for mailer

'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'viewPath' => '@common/mail',

            'transport' => [
                'class' => 'Swift_SmtpTransport',
                'host' => 'smtp.gmail.com',  // e.g. smtp.mandrillapp.com or smtp.gmail.com
                'username' => 'example@gmail.com', //ses-smtp-user.20180221-103827  username: administrator
                'password' => "example123#",
                'port' => '587', // Port 25 is a very common port too 25, 465 or 587
                'encryption' => 'tls', // It is often used, check your provider or mail server specs
                'streamOptions' => [
                    'ssl' => [
                        'verify_peer' => false,
                        'verify_peer_name' => 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' => false,
        ],

if anyone knows what's the issue please let me know i am not getting where is the mistake thanks!

Pranay Sute
  • 441
  • 1
  • 8
  • 21
  • your code? you need to add the related code or config for the problem apparently, add the configurations for the swiftmailer that you are using. you probably are providing invalid credentials for the email – Muhammad Omer Aslam Feb 08 '19 at 10:45
  • well i have updated my question please check. – Pranay Sute Feb 08 '19 at 10:54
  • I guess, In your google account allow less secure apps to connect. Possible Duplicate https://stackoverflow.com/questions/12663783/php-fatal-error-swift-transportexception-with-message-failed-to-authenticate – Insane Skull Feb 08 '19 at 12:17
  • well i have already made this changes in my google account but still i am facing this issue. I am not getting where is the error. – Pranay Sute Feb 09 '19 at 06:45

0 Answers0