Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cannot send email #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghpeppe opened this issue Jul 24, 2023 · 3 comments
Closed

cannot send email #57

ghpeppe opened this issue Jul 24, 2023 · 3 comments

Comments

@ghpeppe
Copy link

ghpeppe commented Jul 24, 2023

Hi, I'm migrating from swiftmail to symfonymail.
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

[EDIT]
Suppressing the customized class MiaMessage and using the standard one, the behavior is the same.


Yii 2.0.48
yii2-symfonymailer 3.0.0
PHP 7.3.x

@rhertogh
Copy link

Are you sure you should be using port 25? smtps often uses port 587.

@ghpeppe
Copy link
Author

ghpeppe commented Jul 24, 2023

Are you sure you should be using port 25? smtps often uses port 587.

Yes. Parameters by our system admin.
And it worked for years with swiftmail.

@samdark
Copy link
Member

samdark commented Jul 25, 2023

It is a bit different from Swiftmailer config-wise: symfony/symfony#34846

So encryption type should be set explicitly as tls or smtps (for port 465).

@samdark samdark closed this as completed Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants