Prerequisites

To get the most out of this guide, you will need to:

1. Install

Get the Resend PHP SDK.

Composer
composer require resend/resend-php

2. Send email using HTML

The easiest way to send an email is by using the html parameter.

index.php
<?php

require __DIR__ . '/vendor/autoload.php';

$resend = Resend::client('re_123456789');

$resend->emails->send([
  'from' => 'Acme <onboarding@resend.dev>',
  'to' => ['delivered@resend.dev'],
  'subject' => 'hello world',
  'html' => '<strong>it works!</strong>',
]);

3. Try it yourself

PHP Example

See the full source code.