I have a Laravel web app, I use mailgun as an API for every client to receive an email. On local I use SMTP, it was working fine. But when I upload the web app onto the production and change my settings to API it has no error, every email that was sent didn't receive any. I've done everything but still no luck.
.env
MAIL_DRIVER=mailgun
MAILGUN_DOMAIN=https://api.mailgun.net/v3/sandbox(mydomain).mailgun.org
MAILGUN_SECRET=key-(my-secret-key)
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
config/services.php
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
config/mail.php
<?php
return [
'driver' => env('MAIL_DRIVER', 'mailgun'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'noreply@domain.com'),
'name' => env('MAIL_FROM_NAME', 'Domain'),
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => null,
'password' => null,
'sendmail' => '/usr/sbin/sendmail -bs',
];