Answer the question
In order to leave comments, you need to log in
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
$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) {
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question