What is a Mailable in Laravel?

Why Interviewers Ask This

Foundational questions like this help interviewers calibrate the rest of the interview. A confident, accurate answer signals that you have solid Laravel basics — a prerequisite for any developer role.

Answer

A Mailable is a class representing an email message in Laravel. Generate: php artisan make:mail WelcomeEmail. The class defines the email content using the fluent envelope() and content() methods (Laravel 9+): public function envelope(): Envelope { return new Envelope(subject: "Welcome!"); } and public function content(): Content { return new Content(view: "emails.welcome"); }. Pass data to the view through constructor properties. Send synchronously: Mail::to($user)->send(new WelcomeEmail($user)). Send to queue: Mail::to($user)->queue(new WelcomeEmail($user)). Preview in browser by returning the Mailable from a route. Configure mail drivers in config/mail.php: SMTP, Mailgun, Postmark, Amazon SES, or Sendmail.

Pro Tip

This topic has Laravel-specific nuances that differ from general programming. Highlighting those nuances in your answer shows expertise rather than generic knowledge.