MailGun returning error 421 on Laravel Application

Viewed 45

I have a free tier account on MailGun and I'm trying to configure the application to send the user a token to reset his password but I keep getting the following error in my browser console. "Expected response code "220" but got code "421", with message "421 Server busy, too many connections".

This is how my .env file is configured

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=postmaster@sandbox6xxxxxxxxxxxxxxx.mailgun.org
MAIL_PASSWORD=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
MAIL_ENCRYPTION=tls
1 Answers

Why are you using the smtp config? Laravel comes with a Mailgun driver built in. You should be setting your MAILER to mailgun and then configuring your mailgun domain, key, and email address.

See here: https://laravel.com/docs/9.x/mail#mailgun-driver

Related