Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jakubjv's avatar

Mailtrap, emails are sent but not delivered

Hello everyone, i have problem about sending emails from my laravel app in development using mailtrap. In mailtrap inbox i can see, that emails were send, but they are not delivered on specific email, where it should be delivered. Or is it because i am using mailtrap email testing, and its not able to send email to real email inbox like my personal email?

My env looks like that

MAIL_MAILER=smtp
MAIL_HOST=sandbox.smtp.mailtrap.io
MAIL_PORT=587
MAIL_USERNAME=mailtrapusername
MAIL_PASSWORD=mailtrappassword
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

my config looks like this

 'mailers' => [
        'smtp' => [
            'transport' => 'smtp',
            'url' => env('MAIL_URL'),
            'host' => env('MAIL_HOST', 'sandbox.smtp.mailtrap.io'),
            'port' => env('MAIL_PORT', 587),
            'encryption' => env('MAIL_ENCRYPTION', 'tls'),
            'username' => env('MAIL_USERNAME', 'mailtrapusername'),
            'password' => env('MAIL_PASSWORD', 'mailtrappassword'),
            'timeout' => null,
            'local_domain' => env('MAIL_EHLO_DOMAIN'),

            'auth_mode' => 'plain',
            'verify_peer' => false,
        ],

I am not getting any errors, when user confirm reservation, he should get confirmation email about that, in mailtrap i can see that email was send, but when i check inbox of my testing email, it doesnt work, and i have tryied couple of different domains. Do have anybody idea what can be a problem ? :/ Thank you.

0 likes
14 replies
tisuchi's avatar

@jakubjv It seems you are using sandbox (sandbox.smtp.mailtrap.io). To send the real email, you need to use production HOST for the mail server.

If you want to continue with mailtrap, then after setting up the account with mailtrap, you need to use a real SMTP host. It may be like this:

...
MAIL_HOST=smtp.mailtrap.io
...
jakubjv's avatar

@tisuchi but if i undestand that right, for that i already need to have real domain, am I right? :)

Snapey's avatar

Incase you missed it

Mailtrap is for TESTING, it does not send email anywhere else.

jakubjv's avatar

@Snapey and this sentence in their FAQ " What is Mailtrap? Mailtrap is an Email Delivery Platform for businesses and individuals to test, send, and control email infrastructure in one place. " ... Is exactly what?

Snapey's avatar
Snapey
Best Answer
Level 122

@jakubjv notice on the menu "Email Testing" and "Email Sending"

then go to the pricing plan and look down the 'Free' plan. Notice "Forwarded emails per month"

If you are on a paid plan then you should discuss with them, or consult their docs to see how you differentiate between email testing and email sending.

1 like
jakubjv's avatar

@Snapey I know about these options, but my app will send something about 350 - 400 verification emails per mont, i think mailtrap can be used freely for that amount of emails. But u confused me with that u said, that mailtrap isnt sending mails. But while i am testing it, i know that without domain it cant reach any emai on any domain, but i c an see that mail was sent in mailtrap inbox. So i think it actually send emails, or it will on production, won't it?

jakubjv's avatar

@Snapey sorry, my misunderstanding of mailtrap... i will find better service for my purpouse

Mailtrap's avatar

Hi @jakubjv, @tisuchi and @snapey! Mailtrap is here :)

There are actually two separate products within ONE Mailtrap Email Delivery platform.

  • One is Email Sending.
  • The other is Email Testing.

You are using the host endpoint for testing in your code: MAIL_HOST=sandbox.smtp.mailtrap.io It is a testing host. You can’t send with it.

Email Testing works with fake SMTP server. And it doesn’t send emails. It captures SMTP traffic for troubleshooting and debugging on staging.

If you need to send emails, you have to use Email Sending host, which is: live.smtp.mailtrap.io

For this purpose, you need to have a sending domain verified with Mailtrap. So yes, you CAN send with Mailtrap. Just use the Sending solution.

1 like

Please or to participate in this conversation.