Cannot send email with yii2-symfonymailer

Hi, yet migrating from swiftmail.
This is the configuration:

        'mailer' => [
            'class' => \yii\symfonymailer\Mailer::class,
            'useFileTransport' => false,
            'messageClass' => 'app\components\MiaMessage',
            'transport' => [
                'scheme' => 'smtps',
                'host' => 'smtps.xxxx.xx',
                'username' => 'aaaaa',
                'password' => 'bbbbb',
                'port' => 25,
                'options' => [
                    'verify_peer' => 0,
                ],
            ],
            'viewPath' => '@app/mail',
        ],

When executing the “send” command, this is the error shown:

Symfony\Component\Mailer\Exception\TransportException
Connection could not be established with host "ssl://smtps.xxxx.xx:25": stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number

I can’t find any solution. Can someone helps me?
Thanks

Yii 2.0.48

Found the solution. Just correct this configuration row:

                'scheme' => 'smtp',
1 Like

Hi,
I has problem with symphony mailer certificate verification fail.
Thanks to your config,
‘options’ => [
‘verify_peer’ => 0,
],
solve my problem.
My question is, where do you found info about that options. I cant find it. If i didnt found your post, i would still struggling with the mailer config. Any documentation about that options somewhere?

Here is the original documentation: