404 not found mailgun domain on laravel

laravel mailgun
mailgun domain not found
mailgun setup in laravel
sendmail laravel
send email from laravel
mailgun ios app
laravel 5.8 send email
laravel sparkpost

i'm actually struggling with mailgun's on laravel, I'm on laravel 6, i've set up auth and am trying to make the password reset functionnality work. So i decided to use mailgun as email server,

here is my .env file :

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:************
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=******
DB_USERNAME=******
DB_PASSWORD=******

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=postmaster@parisworld.ovh
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=tls

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

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', 'support@parisworld.ovh'),
        'name' => env('MAIL_FROM_NAME', 'Parisworld support'),
    ],
   'encryption' => env('MAIL_ENCRYPTION', 'tls'),
   'username' => env('MAIL_USERNAME'),
   'password' => env('MAIL_PASSWORD'),
   'sendmail' => '/usr/sbin/sendmail -bs',
   'markdown' => [
        'theme' => 'default',

        'paths' => [
            resource_path('views/vendor/mail'),
        ],
    ],
   'log_channel' => env('MAIL_LOG_CHANNEL'),
]

And my services.php:

<?php

   return [
    'mailgun' => [
        'domain' => env('MAILGUN_DOMAIN', 'parisworld.ovh'),
        'secret' => env('MAILGUN_SECRET', '********'),
    ],

    'postmark' => [
        'token' => env('POSTMARK_TOKEN'),
    ],

    'ses' => [
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
    ],

];

I don't get what I'm actually missing, i configured the mailgun domain and verified the dns, everything is fine on mailgun side, I could even send myself a mail using the curl method but when I try to reset my password from my app I'm getting this error :

Client error: `POST https://api.mailgun.net/v3/parisworld.ovh/messages.mime` resulted in a `404 NOT FOUND` response: { "message": "Domain not found: parisworld.ovh" } 

I hope this post is clear enought, any idea is welcome :)

  1. On Mailgun Domains page (ex. https://app.eu.mailgun.com/app/sending/domains) get your domain region;
  2. Check Domain Settings -> DNS records;
  3. Edit .env-file:

.env file

MAIL_DRIVER=mailgun
MAILGUN_DOMAIN=mg.docm****.***
MAILGUN_SECRET=d76da6b39e********

# For EU Mailgun domain region
MAILGUN_ENDPOINT=api.eu.mailgun.net

# For US Mailgun domain region
MAILGUN_ENDPOINT=api.mailgun.net

More information about endpoints https://documentation.mailgun.com/en/latest/api-intro.html#mailgun-regions

Mailgun: Domains page

Mailgun: Domain Settings -> DNS records

Mailgun: Domain Settings -> DNS records 2

MailGun Client error: `POST https://api. resulted in a `404 NOT , php line 111: Client error: `POST https://api.mailgun.net/v3//messages.mime` resulted in a `404 NOT FOUND` response: <!doctype html> <!--[if lt  Forum Laravel Laravel 5.8 / Route not found (404 error) but exist. Reply Follow All Threads Popular This Week Popular All Time Solved Unsolved No Replies Yet

Well i found the solution of this problem, I created my account in EU, by default when you refer the mailgun api url, smtp.maigun.org corresponds to the US api. So laravel was looking for the domain parisworld.ovh in the US api while it was registered in EU. To work with mailgun's eu api you have to change in .env (in my case):

MAIL_HOST=smtp.mailgun.org

to

MAIL_HOST=smtp.eu.mailgun.org

I don't know why but i still had an authentification problem :

To solve this one, I just had to reset my smtp password from the mailgun interface, paste the new password in my .env and it's now working ! Hope this post will help some :)

Mailgun not able to send email, I used mailgun's api but I keep getting this error anytime I try to send mails. Client error:PO. resulted in a 404 NOT FOUND` response: 404 Not  A domain ownership. Mailgun account. CPanel access. Laravel Framework (5.2, 5.3 or 5.4) installed. Mailgun: Adding a custom domain. In your account dashboard, go to custom domains section and click on add new domain. Mailgun recommends using a subdomain e.g. mg.mydomain.com. Using a subdomain still, allows us to send emails from the root domain

If you are in the EU you need to make sure you set the following in your config/services.php

'mailgun' => [
    'domain' => env('MAILGUN_DOMAIN'),
    'endpoint' => env('MAILGUN_ENDPOINT'),
    'secret' => env('MAILGUN_SECRET'),
],

and then add the following to your .env

MAILGUN_ENDPOINT=api.eu.mailgun.net

and then

php artisan config:cache

Laravel and Mailgun, Laravel and Mailgun .mailgun.org/messages.mime resulted in a 404 NOT FOUND response: set the domain as sandboxxxxxxxxxxxxxxxxxxxx.mailgun.​org. So, even though I bought my domain name through Google Domains I configured my domain name server on the Digital Ocean side. If you’re interested in how to hook up a custom domain to Laravel Forge I recommend this (free) video. Once you’ve created a Mailgun account, you’ll need to verify your domain, which takes about 24 hours.

Introduction, in your Control Panel. API and SMTP regions can be found at Mailgun Regions For domains created in our EU region the base URL is: https://api.eu.mailgun.​net/v3 404, Not Found - The requested item doesn't exist. 413, Request Entity  Laravel provides a clean, simple API over the popular SwiftMailer library with drivers for SMTP, Mailgun, Postmark, Amazon SES, and sendmail, allowing you to quickly get started sending mail through a local or cloud based service of your choice. Configuration. Laravel's email services may be configured via the mail configuration file. Each

Build Laravel 5.7 Email Authentication With Mailgun And Digital Ocean, The newly released Laravel version 5.7 adds a new capability to verify user's Once you have a working Mailgun domain, head to the dashboard to find your API key. Landing page if the user has not verified their email. The cool thing about mailgun is that you can send out 10,000 emails for free every month! Mailgun is really cool and you'll be falling in love with it in no time. So, let's walk through 5 simple steps on how to send your first test email with Mailgun and Laravel. 5 Steps to integrate Mailgun with Laravel. 1.

Mailgun Transport for Europe Zone · Issue #25009 · laravel , Description: Recently Mailgun added a new feature which let users choose a The new URL is: https://api.eu.mailgun.net/v3/{domain}/messages.mime Might not be the best way to solve the issue, but it's working for me. Introduction¶ The Mailgun API is built on HTTP. Our API is RESTful and it: Uses predictable, resource-oriented URLs. Uses built-in HTTP capabilities for passing parameters and authentication. Responds with standard HTTP response codes to indicate errors. Returns JSON. Mailgun has published Libraries for various languages. You may use our

Comments
  • Thanks! I'm in the Netherlands and this works for me!