Install
terminal
composer require mail-craft/mailcraft-phpSend email
Send from a verified sender on one of your domains.
index.php
use MailCraft\MailCraft;
$mailcraft = new MailCraft(getenv('MAILCRAFT_API_KEY'));
$mailcraft->emails->send(
from: '[email protected]',
to: ['[email protected]'],
subject: 'Welcome!',
html: '<p>Thanks for signing up.</p>',
); Keep your API key in the MAILCRAFT_API_KEY environment variable, never in source control. Create one under Settings → API keys, scoped to just what this app needs.