Send email from PHP with Lettr
Lettr works with PHP through the lettr/lettr-php package on Packagist.
Checked
What you can do
- Send email with the fluent builder or templates
- Manage domains and webhooks
- Manage your audience and campaigns
How to set it up
composer require lettr/lettr-phpuse Lettr\Lettr;
$lettr = Lettr::client(getenv('LETTR_API_KEY'));
$lettr->emails()->sendHtml(
from: 'sender@yourdomain.com',
to: 'recipient@example.com',
subject: 'Hello',
html: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
);Requirements
- PHP 8.4 or later
- Guzzle 7.5 or later, which Composer installs