-1

my server is linux based. please helpme with the proper mailer config

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

            // 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,
            'transport' => [
                'class' => 'Swift_SmtpTransport',
                'host' => 'smtp.gmail.com',
                'port' => '465',
                'encryption' => 'ssl',              
            ],
        ],
Erose
  • 1
  • Possible duplicate of [Using php's swiftmailer with gmail](https://stackoverflow.com/questions/3478906/using-phps-swiftmailer-with-gmail) – rob006 Aug 02 '18 at 08:10

1 Answers1

0

for gmail should be port 587 encryption tls

        'transport' => [
            'class' => 'Swift_SmtpTransport',
            'host' => 'smtp.gmail.com',
            'username' => 'your.username@gmail.com',
            'password' => 'yourpassword',
            'port' => '587',
            'encryption' => 'tls',
        ],
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
  • getting error: Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at535 5.7.8https://support.google.com/mail/?p=BadCredentials r71-v6sm1617332pfg.43 - gsmtp" – Erose Aug 02 '18 at 06:41
  • the server is responding: but seems you have problem with your credential ..check better – ScaisEdge Aug 02 '18 at 07:05