Swiftmailer not sending

Yii 2 Advance App template

I am trying to send mail in an API Action

Config:





   'mailer' => [

            'class' => 'yii\swiftmailer\Mailer',

            'useFileTransport' => 'false',

            'viewPath' => "@common/mail",

            'transport' => [

                'class' => 'Swift_SmtpTransport',

                'host' => 'host',

                'username' => 'name',

                'password' => '***',

                'port' => '25',

                'encryption' => 'TLS'

            ],

        ],






Controller:




Yii::$app->mailer->compose('layouts/html', ['content' => 'something'])

  ->setFrom([Yii::$app->params['adminEmail'] => 'Test Mail'])

  ->setTo('receiver@something.com')

  ->setSubject('This is a test mail ')

  ->send();



View path is correct, checked and confirmed.

the send() returns 1 which is TRUE, as in sending success but no email was received in two different receiver I have tried (spam/junk checked)

Any help will be appreciated!

Try [font=“Courier New”]‘useFileTransport’ => false[/font] instead of [font=“Courier New”]‘false’[/font].

Thank you, I didn’t realized about that.