Are you 100% sure that you're using the correct username and password?
Connection could not be established with host "live.smtp.mailtrap.io:587": stream_socket_client(): Unable to connect to live.smtp.mailtrap.io:587 (Connection refused)
I have seen everywhere about this problem and found no solution.
I found in one discussion that if you put mail in "transport" configuration in "mail" config file it just works and dont know why it worked.
I have this setting in mail config file which does not work and gives the above error.
This error occurs only in production and not in local.
I am using Godaddy Hosting.
'mailers' => [ 'smtp' => [ 'transport' => 'smtp', 'host' => env('MAIL_HOST', 'smtp.postmarkapp.com'), 'port' => env('MAIL_PORT', 587), 'encryption' => env('MAIL_ENCRYPTION', 'TLS'), 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'timeout' => null, ],
My env config are
MAIL_MAILER="smtp" MAIL_HOST=live.smtp.mailtrap.io MAIL_PORT=587 MAIL_USERNAME=api MAIL_PASSWORD=sdfsdfdsfsdf MAIL_ENCRYPTION=tls [email protected] MAIL_FROM_NAME="${APP_NAME}" [email protected]
Please or to participate in this conversation.