Home API Tools Posts Hire Me About
Sign In Create Account
Laravel

Laravel Mail: Sending Emails

January 16, 2026 1 min read 42 views

Send emails with Laravel:

Create Mailable

php artisan make:mail WelcomeEmail

Mailable Class

class WelcomeEmail extends Mailable
{
    public function __construct(public User $user) {}

    public function content(): Content
    {
        return new Content(
            view: 'emails.welcome',
        );
    }
}

Send Email

Mail::to($user)->send(new WelcomeEmail($user));
Mail::to($user)->queue(new WelcomeEmail($user));

With Attachments

public function attachments(): array
{
    return [
        Attachment::fromPath('/path/to/file.pdf'),
    ];
}
Share this post:

Related Posts

Comments (0)

Please log in to leave a comment. Log in

No comments yet. Be the first to comment!