Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Respect's avatar

laravel 10 mailgun settings error

  • Hello Friends Thanks So Much For Reading & help
  • i need send emails using mailgun settings i did all settings but i got this error
Swift_TransportException
Request to Mailgun API failed.
  • my settings looks like
MAIL_MAILER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=the_password
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME=testapp
  • Thanks For reading And trying help
0 likes
5 replies
Respect's avatar

@tisuchi thanks for answer it does not work, in laravel 10 mail settings no place for key too

1 like
kokoshneta's avatar

Your settings appear to be for Mailgun’s SMTP relay service, which I don’t think Laravel supports. Laravel uses the Mailgun HTTP API (which is more flexible than simple SMTP relay).

In order for the HTTP API to work, you need the MAILGUN_DOMAIN and MAILGUN_SECRET keys in your .env file. You get those from your Mailgun dashboard by verifying your domain with Mailgun.

1 like
Snapey's avatar
Snapey
Best Answer
Level 122

or change MAIL_MAILER=mailgun to MAIL_MAILER=smtp

1 like

Please or to participate in this conversation.