Ошибка при отправке писем Laravel 8
При отправке сообщений с сайта (из формы обратной связи) выскакивает ошибка 500.
local.ERROR: Connection could not be established with host smtp.beget.com :stream_socket_client():
SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:
wrong version number {"exception":"[object] (Swift_TransportException(code: 0):
Connection could not be established with host smtp.beget.com
:stream_socket_client(): SSL operation failed with code 1.
OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number at
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:261)
Настройки файла .env
MAIL_MAILER=smtp
MAIL_HOST=smtp.beget.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=myPassword
MAIL_ENCRYPTION=ssl
[email protected]
MAIL_FROM_NAME="${APP_NAME}
Настройка файла config/mail.php
'transport' => 'smtp',
'host' => env('MAIL_HOST', ''),
'port' => env('MAIL_PORT', 465),
'encryption' => env('MAIL_ENCRYPTION', ),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'auth_mode' => null,
Контролер FeedBackMessage.php
Mail::send('email', [
'name' => $request->get('name'),
'email' => $request->get('email'),
'street' => $request->get('street'),
'number' => $request->get('number'),
'themes' => $request->get('themes'),
'msg' => $request->get('msg')
],
function ($message) {
$message->from('[email protected]');
$message->to('[email protected]')
->subject('Сообщение с сайта');
}
);
До вчерашнего вечера все было хорошо, но были настройки для YandexMail. Далее днем пришло сообщения от вышеупомянутых ям, что мол много спама, и ящик пока что будет в блоке.
Решил сменить настройки почты на те что предоставил хостинг, все данные вносил согласно инструкциям, но вот Laravel выдает 500 ошибку при отправке почты из формы.