They are for test, not for API implementation. Add your domain and verify it, takes literally 1 minute.
Sending emails with Mailgun
I'm trying to use Mailgun to send emails to my users in my app. Unfortunately, I can't get this to work. I added a custom domain and I'm waiting for that to be verified. In the meantime, I'd like to continue working on my app on my development machine. I can't get this to work and it's getting really frustrating.
First, I tried sending it using the mailgun driver:
MAIL_DRIVER=mailgun
MAILGUN_DOMAIN=sandbox-------------------.mailgun.org
MAILGUN_SECRET=key-----------------------
Unfortunately, I get the following error:
Client error: `POST https://api.mailgun.net/v3/sandbox-----------------------.mailgun.org/messages.mime`
resulted in a `400 BAD REQUEST` response: {
"message": "Sandbox subdomains are for test purposes only.
Please add your own domain or add the address to authoriz (truncated...)
So instead, I tried using smtp:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=25
MAIL_USERNAME=postmaster@sandbox------------------------.mailgun.org
MAIL_PASSWORD=somePassword
MAIL_ENCRYPTION=null
which also thrown an exception:
Expected response code 250 but got code "554",
with message "554 Sandbox subdomains are for
test purposes only. Please add your own domain or
add the address to authorized recipients in domain
settings. "
Which begs the question: what are these sandbox domains for? How can and should they be used? I'm at a loss here..
And how are you supposed to send emails in a development setting using Mailgun?
Please or to participate in this conversation.