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

TPDev's avatar
Level 1

Laravel sending mail via mailtrap not working with no errors

Attempting to send some dev testing emails from a Laravel Application. Followed this guide here: https://www.youtube.com/watch?v=zu-ZniGhogw

made a mailtrap.io account inbox, copied all its details to .env Everything works as in the video, however no email is sent or received in the mailbox Also when trying to log the email instead nothing is happening. No errors, nowhere.

app\mail\NewUserWelcome.php

public function build()
{
    return $this->markdown('emails.newuserwelcome');
}

Controller method:

public function email()
{
    Mail::to(Auth::user()->email)->send(new NewUserWelcome());
    return redirect ('/home');
}

resources\views\emails\newuserwelcome.blade.php

@component('mail::message')

Welcome to Application Name

Thanks for signing up. **We really appreciate** it. Let us _know if we can_ do more to please you!

@component('mail::button', ['url' => 'http://localhost:8000/home']) View My HomePage @endcomponent

Thanks, {{ config('app.name') }} @endcomponent

This is my app\config\mail.php

'driver' => env('MAIL_DRIVER', 'smtp'), host' => env('MAIL_HOST', 'smtp.mailtrap.io'), 'port' => env('MAIL_PORT', 2525), 'from' => [ 'address' => env('MAIL_FROM_ADDRESS', '[email protected]'), 'name' => env('MAIL_FROM_NAME', 'Example'), ], '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'),
    ],
],

"pretend" => false

This is my .env:

MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=xxxxxxxxxxxxxxxxx MAIL_PASSWORD=xxxxxxxxxxxxxxxxx MAIL_ENCRYPTION=tls [email protected] MAIL_FROM_NAME=Example

I've tested this locally on a WAMP server And Remotely on Ubunto LAMP server same results (I.E nothing happening)

-Thanks for any help you can provide

0 likes
7 replies
TPDev's avatar
TPDev
OP
Best Answer
Level 1

solution was a complete server restart...

1 like
Tominator's avatar

I rebooted my VM, but that didn't help. I'm also stuck on the "no errors, connects fine, just doesn't arrive in my inbox" state.

yengish04's avatar

Same problem I am facing did you receive any solutions. Please share with me.

Please or to participate in this conversation.