I am implementing Mailgun in Laravel. I did all the configuration and from localhost it works perfect, but when I deploy in Heroku I get the following error:
Client error:
POST https://api.mailgun.net/v3/sandbox75c537762edc4d29becf4de26ec1738b.mailgun.org/messages.mime
resulted in a400 BAD REQUEST
response: {"message": "Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authoriz (truncated ...)
I am using my own domain, I do not know what will be failing, but in localhost the emails are sent without problem.
.env file
MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=1567---ca----b3f74f23fe
MAIL_ENCRYPTION=tls
MAILGUN_DOMAIN=email.Mydomain.co
MAILGUN_SECRET=key-03be65a7c90-----f51d---83e4
Services
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
],