0

I have problem with my laravel project. before, my project can sending email. but now, email not working. I get problem

Expected response code 220 but got code "421", with message "421 5.7.1 Connection refused "

I have using smtp Gmail, and another smtp from my client but same. this is my env

enter image description here

I hope, sending email in my project can working again.

Dhiemas Ganisha
  • 223
  • 2
  • 15

3 Answers3

0

.env should look like

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=abc@gmail.com
MAIL_PASSWORD=**************
MAIL_ENCRYPTION=tls
albus_severus
  • 3,626
  • 1
  • 13
  • 25
0

I had the same issue until I removed the # from the password. I know, it shouldn't be like that but hey, it solved it for me...

0

All looks good. But one issue it could be is that your password has characters in it that .env file see's as some executable code. For example in Rod Chadwick's answer. A # means inline documentation. Which pritty sure was the reason for his error.

Url encoding is what you should use for your password. And maybe also for your username. You can url encode online here: https://www.urlencoder.org/

Allart
  • 830
  • 11
  • 33