Reliable email API for PHP developers

An email API that fits right into your PHP apps with production-ready SDKs and clean documentation. Get 500 emails/month free or upgrade for as little as $7.

MailerSend

PHP email that just works

Clean, modern PHP API

Built for modern PHP (7.4+) with a clean, chainable interface that keeps your code readable.

Universal HTTP client support

Plays nicely with your preferred HTTP client thanks to PSR-7 and PSR-18 support.

Exceptions you can branch on

Proper error handling built in with dedicated exceptions for validation and rate limit errors.

Infrastructure you can rely on

Precision-engineered infrastructure with outstanding deliverability at every level and 99.99% standard uptime.

Fast, straightforward integration with your PHP app

Install via Composer, grab your API key, and start sending. It’s that simple.
use MailerSend\MailerSend;
use MailerSend\Helpers\Builder\Recipient;
use MailerSend\Helpers\Builder\EmailParams;

$mailersend = new MailerSend();

$recipients = [
    new Recipient('your@client.com', 'Your Client'),
];

$emailParams = (new EmailParams())
    ->setFrom('your@domain.com')
    ->setFromName('Your Name')
    ->setRecipients($recipients)
    ->setSubject('Subject')
    ->setHtml('This is the HTML content')
    ->setText('This is the text content')
    ->setReplyTo('reply to')
    ->setReplyToName('reply to name');

$mailersend->email->send($emailParams);
use MailerSend\MailerSend;
use MailerSend\Helpers\Builder\Recipient;
use MailerSend\Helpers\Builder\EmailParams;

$mailersend = new MailerSend();

$bulkEmailParams = [];

$bulkEmailParams[] = (new EmailParams())
    ->setFrom('your@domain.com')
    ->setFromName('Your Name')
    ->setRecipients([
        new Recipient('recipient1@client.com', 'Your Client'),
    ])
    ->setSubject('Subject')
    ->setHtml('This is the HTML content')
    ->setText('This is the text content');

$bulkEmailParams[] = (new EmailParams())
    ->setFrom('your@domain.com')
    ->setFromName('Your Name')
    ->setRecipients([
        new Recipient('recipient2@client.com', 'Your Client'),
    ])
    ->setSubject('Subject')
    ->setHtml('This is the HTML content')
    ->setText('This is the text content');

$mailersend->bulkEmail->send($bulkEmailParams);
use MailerSend\MailerSend;
use MailerSend\Helpers\Builder\ActivityParams;

$mailersend = new MailerSend(['api_key' => 'key']);

$mailersend->activity->find('activity_id');
use MailerSend\MailerSend;
use MailerSend\Helpers\Builder\DomainParams;

$mailersend = new MailerSend();

$domainParams = (new DomainParams('domainName'))
                    ->setReturnPathSubdomain('returnPath')
                    ->setCustomTrackingSubdomain('customTracking')
                    ->getInboundRoutingSubdomain('inboundRouting');

$mailersend->domain->create($domainParams);
use MailerSend\MailerSend;
use MailerSend\Helpers\Builder\TokenParams;

$mailersend = new MailerSend();

$mailersend->token->create(
    new TokenParams('token name', 'domainId', TokenParams::ALL_SCOPES)
);
use MailerSend\Helpers\Builder\WebhookParams;
use MailerSend\MailerSend;

$mailersend = new MailerSend();

$mailersend->webhooks->create(
    new WebhookParams('https://webhook_url', 'Webhook name', WebhookParams::ALL_ACTIVITIES, 'domain_id')
);

// Or a disabled webhook

$mailersend->webhooks->create(
    new WebhookParams('https://webhook_url', 'Webhook name', WebhookParams::ALL_ACTIVITIES, 'domain_id', false)
);

// Or with a specific webhook payload version (1 or 2)

$mailersend->webhooks->create(
    new WebhookParams('https://webhook_url', 'Webhook name', WebhookParams::ALL_ACTIVITIES, 'domain_id', true, 2)
);

Ready to give it a go?

You can send your first email in minutes with a free Trial account. 

MailerSend

Domain authentication handled automatically

Add your domain, use the auto-connect wizard to automatically configure SPF, DKIM and MX records, and get sending. No manual configuration needed.

MailerSend

Webhook-powered event handling

Set up webhook endpoints in your PHP app and react instantly with your own business logic to deliveries, bounces, opens, clicks, and more. No polling, no guesswork. 

MailerSend

Scale for multiple channels without switching APIs

Go beyond email and integrate SMS (USA & Canada) and WhatsApp (coming soon) without the need for multiple platforms or accounts. More channels, one platform, one API, one SDK.

MailerSend

Keep dynamic templates outside your codebase

Manage templates in MailerSend, inject dynamic content at the point of sending, and let your team easily update designs without redeployment. 

MailerSend

Route incoming emails straight to your PHP app

Out-of-the-box inbound routing lets you effortlessly parse incoming email data as clean, structured JSON and route it to a webhook endpoint or email address.

Technical support 24/7

Get fast, responsive support when you need it from an award-winning support team. Real help is just a click away via email or live chat.

93% satisfaction rate
100% response rate
24/7 support hours
I would recommend MailerSend because of the great support I got every time I struggled with something. Fast response times and competent help is my main experience so far. The API documentation and integration are straightforward. Templates can be handled by marketing without developer skills.
Norbert N. CTO
Before MailerSend, we were always worried that emails would go to spam or promotions, but now our clients sometimes ask "How did your FIRST email get into my inbox with a star on it?". For us, email is critical for the businesses that we help and MailerSend plays a critical role. Better still, they have humans that respond and read what you write to them.
Rodrigo S. CEO
Very good tool, it took me just one day to get it working on production. The interface is clean with everything exactly where expected. It works fantastically—emails are delivered immediately and as configured (conditional statements saved my life, no need to create lots of templates). The API documentation is also fantastic, plus the support team is really fast! 10 out of 10.
Roger S. -

Send your first email now

Sign up and send your first email in minutes with a trial domain. Get 500 emails/month free or upgrade for as little as $7/month for more emails and features. 

FAQs

What are the minimum PHP version requirements for the SDK?

MailerSend’s SDK is compatible with PHP 7.4 and above. 

Which PSR standards does this library use for HTTP requests?

The MailerSend SDK supports PSR-7 and PSR-18. 

How do I add attachments like images or PDFs to my emails?

To add attachments to your emails, you can use the $attachments parameter. Check our GitHub documentation for an example. 

Does the SDK handle bulk email sending and status tracking?

Yes, the MailerSend PHP SDK has endpoints for sending bulk emails and activity. 

Can I programmatically manage webhooks and inbound routing?

Yes, our API covers all MailerSend features.

Is this SDK compatible with older versions of Laravel?

The latest version of our SDK is not compatible with Laravel 8.0 or lower. We recommend that you use an older version of the SDK or, preferably, update your Laravel version. 

Does the SDK support both HTML and plain text email formats?

Yes, you can send HTML, plain text or templated emails. 

Can I use this library to send and manage transactional SMS?

Yes, the library includes endpoints for sending and managing transactional SMSes. Note that SMS is currently only available for senders in the USA and Canada. 

What are MailerSend’s rate limits?

The API rate limit for all endpoints (excluding v1/email) is 60 requests/minutes, and for v1/email the limit is 120 requests/minutes. For details about bulk request limits, check our guide on rate limits