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

Speedbone's avatar

Mail class not found

Hi again,

no matter what i try: use Mail; use App\Mail; etc.

Im getting Class 'App\Http\Controllers\Mail' not found in my laravel logs. (Mail is set to log)

0 likes
7 replies
joedawson's avatar

Can we take a peep at your controller? Is App also the correct app namespace?

Speedbone's avatar
use App\Http\Requests;

use App\Http\Controllers\Controller;

use Illuminate\Mail\Mailer;

use Illuminate\Http\Request;

Mail::send('emails.paypal', [$raw_post_data], function($message)

{
    $message->to('test@test.de', 'John Smith')->subject('Welcome!');
});
Speedbone's avatar

In which log file should i see the mails? I switched to "log" and pretend mode...

JarekTkaczyk's avatar
Level 53

@Speedbone You need to use either facade or resolve directly from the app:

$mailer = app()['mailer'];
$mailer->send...

// or 
\Mail::send ...


// or
use Mail;
...
Mail::send...
3 likes
Speedbone's avatar

Thanks Jarek .. weird, but it works now.. had a failure in the mail view.. and got this error message.

Please or to participate in this conversation.