Support the ongoing development of Laravel.io →
posted 6 years ago

Hi Everyone,

I need your kind assistance in setting up properly the Laravel Mailbox to my project. I'm aiming to receive incoming email to my Laravel project. As far as I know, I followed all the steps from https://docs.beyondco.de/laravel-mailbox/1.0/getting-started/introduction.html. I used mailgun as the driver. I tested it but, it doesn't seem to be working.

Here's the screenshot of my codes:

.env

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:sHl+G/4iyJxEkgIOTMJKvTfBBVH4AlImg+NMKSu5Vb0=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=blair_project
DB_USERNAME=root
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=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=postmaster@sandbox818fa6c32a3949f1b63e2bd905f81b37.mailgun.org
MAIL_PASSWORD=0f44a16cd8c67e3197b8a4785f5f8b80-39bc661a-846f345a
MAIL_ENCRYPTION=tls
MAILGUN_DOMAIN=sandbox818fa6c32a3949f1b63e2bd905f81b37.mailgun.org
MAILGUN_SECRET=key-d95520cc99adacd82c1fbc8c7627bc87-39bc661a-475c5396


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}"

mailbox.php

<?php

return [

    /*
     * The driver to use when listening for incoming emails.
     * It defaults to the mail driver that you are using.
     *
     * Supported drivers: "log", "mailgun", "sendgrid", "postmark"
     */
    'driver' => env('MAILBOX_DRIVER', 'mailgun'),

    /*
     * The model class to use when converting an incoming email to a message.
     * It must extend the default model class
     */
    'model' => \BeyondCode\Mailbox\InboundEmail::class,

    /*
     * The path for driver specific routes. This is where
     * you need to point your driver specific callbacks
     * to.
     *
     * For example: /laravel-mailbox/sendgrid/
     */
    'path' => '/laravel-mailbox',

    /*
     * The amount of days that incoming emails should be stored in your
     * application. You can use the cleanup artisan command to
     * delete all older inbound emails on a regular basis.
     */
    'store_incoming_emails_for_days' => 7,

    /*
     * By default, this package only stores incoming email messages
     * when they match one of your mailboxes. To store all incoming
     * messages, modify this value.
     */
    'only_store_matching_emails' => false,

    /*
     * Some services do not have their own authentication methods to
     * verify the incoming request. For these services, you need
     * to use this username and password combination for HTTP
     * basic authentication.
     *
     * See the driver specific documentation if it applies to your
     * driver.
     */
    'basic_auth' => [
        'username' => ('postmaster@sandbox818fa6c32a3949f1b63e2bd905f81b37.mailgun.org'),
        'password' => ('0f44a16cd8c67e3197b8a4785f5f8b80-39bc661a-846f345a'),
    ],

    /*
     * Third party service configuration.
     */
    'services' => [

        'mailgun' => [
            'key' => ('d95520cc99adacd82c1fbc8c7627bc87-39bc661a-475c5396'),
        ],

    ],

];

My mailgun route

Expression type - Match Recipient Recipient - postmaster@sandbox818fa6c32a3949f1b63e2bd905f81b37.mailgun.org Store and Notify - http://pureethereal.com/laravel-mailbox/mailgun/mime

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.