G
G
GilbertAmethyst2019-05-24 14:44:28
symfony
GilbertAmethyst, 2019-05-24 14:44:28

How to solve error in Symfony when sending mail: error:1409E10F:SSL routines:ssl3_write_bytes:bad length?

Hello.
There is a php daemon that uses Symfony components.
When trying to send mail, an error occurs, which can be seen in the logs:

PHP Warning:  fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
error:1409E10F:SSL routines:ssl3_write_bytes:bad length in /home/admin/web/_ПАПКА_ПРОЕКТА_/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php on line 231

The sending itself looks like this (the code has not changed, it used to work):
$to_email = "почта@получателя.com";
$message = (new \Swift_Message('Новое обращение'))
                                ->setFrom(['[email protected]ДОМЕН_ПРОЕКТА.com' => 'Поддержка'])
                                ->setTo([$to_email])
                                ->setBody(
                                    '<html>' .
                                    'Здравствуйте. <br>' .
                                    'Вам пришла новая заявка' .
                                    '</body>' .
                                    '</html>',
                                    'text/html' // Mark the content-type as HTML
                                );
                            try {
                                $result = $this->mailer->send($message);
                            } catch (\Exception $e) {

                            }

The error appeared unexpectedly, before everything worked stably, Google did not help, I don’t understand how to find where the legs grow from and how to fix it.
Please tell me what to do in such a situation?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question