Documentation

Everything you need to get started with LaravelSMTP

Quick Start

Get up and running in under 5 minutes

1

Install Package

composer require laravelsmtp/laravel-smtp

Add the package to your Laravel project via Composer.

2

Configure .env

LSMTP_PROVIDER=ses
LSMTP_FROM_ADDRESS=noreply@yourdomain.com

Set your provider and from address in your environment file.

3

Test Setup

php artisan laravelsmtp:test you@domain.com

Verify your configuration by sending a test email.

Advanced Features

Multi-tenant Configuration

Switch email providers per tenant or user at runtime for SaaS applications.

LaravelSMTP::forTenant($tenant)
    ->provider('mailgun')
    ->send($mailable);

Webhook Handling

Automatically process delivery events, bounces, and complaints.

Route::post('/webhooks/email', 
    [WebhookController::class, 'handle']);

Failover Support

Automatically fallback to backup providers when primary fails.

LSMTP_PROVIDER=ses
LSMTP_FALLBACK_PROVIDER=mailgun

Testing & Debugging

Built-in commands for testing email delivery and DNS configuration.

php artisan laravelsmtp:doctor
php artisan laravelsmtp:test email@domain.com

Need Help?