Send emails with PHP
Prerequisites
Section titled “Prerequisites”Before you start, you'll need:
- A Resend API key
- A verified domain
Prefer watching a video? Check out this video walkthrough below.
Install
Get the Resend PHP SDK.
Composer composer require resend/resend-phpSend email using HTML
The easiest way to send an email is by using the
htmlparameter.index.php <?php require __DIR__ . '/vendor/autoload.php'; $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->send([ 'from' => 'Acme <onboarding@resend.dev>', 'to' => ['delivered@resend.dev'], 'subject' => 'hello world', 'html' => '<strong>it works!</strong>', ]);
Examples
Section titled “Examples”Basic Send
Basic, batch, and prevent-threading send
Attachments
File attachments and inline images (CID)
Scheduling
Schedule emails for future delivery
Templates
Send emails using Resend hosted templates
Double Opt-in
Double opt-in subscription flow
Inbound Webhooks
Receive and process inbound emails
Audiences
Manage contacts and audiences
Domains
Create and manage sending domains
Symfony App
Full Symfony web application