Страница 1 из 1

Symfony Mailer + Gmail

Добавлено: 2024.01.28, 12:49
Ghost_nsk
Ребят, приветствую, кто-нибудь успешно использует связку Symfony Mailer + Gmail?

1) Пытаюсь настроить через различные конфиги, пишет:

Код: Выделить всё

Connection could not be established with host "ssl://smtp.gmail.com:465": stream_socket_client(): Unable to connect to ssl://smtp.gmail.com:465 (Operation timed out)
2) если по инструкции указывать

Код: Выделить всё

'transportFactory' => CustomSmtpFactory::class
то вываливается ошибка

Код: Выделить всё

'Cannot assign string to property yii\symfonymailer\Mailer::$transportFactory of type ?Symfony\Component\Mailer\Transport'

Re: Symfony Mailer + Gmail

Добавлено: 2024.01.29, 14:31
SiZE
Ghost_nsk писал(а): 2024.01.28, 12:49 2) если по инструкции указывать

Код: Выделить всё

'transportFactory' => CustomSmtpFactory::class
то вываливается ошибка

Код: Выделить всё

'Cannot assign string to property yii\symfonymailer\Mailer::$transportFactory of type ?Symfony\Component\Mailer\Transport'
В инструкции так

Код: Выделить всё

'container' => [
    'definitions' => [
        EsmtpTransportFactory::class => [
            'class' => CustomSmtpFactory::class,
            'timeout' => 143, //Configure it to your own timeout
        ],
        // ... other definitions
    ],
],
А вы задаете строку там где ожидается null или объект класса Symfony\Component\Mailer\Transport

Re: Symfony Mailer + Gmail

Добавлено: 2024.02.21, 03:28
Ghost_nsk
SiZE писал(а): 2024.01.29, 14:31 А вы задаете строку там где ожидается null или объект класса Symfony\Component\Mailer\Transport
увидел, благодарствую