How can I test email on localhost with Laravel 7? I have a Smtp4Dev server running which should catch communication on the specified port. I choose port 25. My Laravel 7 mail setting is below:
.env
MAIL_MAILER=smtp
MAIL_HOST=xxxxxxxxxx.contaboserver.net
MAIL_PORT=25
MAIL_USERNAME="noreplay@xxxxxxxxx.eu"
MAIL_PASSWORD="xxxxxxxxx"
MAIL_ENCRYPTION=
MAIL_FROM_ADDRESS="noreplay@xxxxxxxxx.eu"
MAIL_FROM_NAME="${APP_NAME}"
config/mail.php
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST'),
'port' => env('MAIL_PORT'),
'encryption' => env('MAIL_ENCRYPTION'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'auth_mode' => null,
'stream' => [
'ssl' => [
'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false,
],
],
],
With these settings I am getting an error:
Failed to authenticate on SMTP server with username "noreplay@xxxxxxxxx.eu" using 3 possible authenticators. Authenticator CRAM-MD5 returned Expected response code 235 but got code "535", with message "535 5.7.0 Invalid login or password ". Authenticator LOGIN returned Expected response code 250 but got an empty response.
If I remove
'stream' => [
'ssl' => [
'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false,
],
],
I get an error
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
I also run artisan config:clear
. I don't know what should I do now. Why local Smtp4dev server requires authentication?