Resend Email Package for Laravel and PHP
Published on by Paul Redmond
Resend for Laravel is a package that provides Resend API integration with mailers. This API is designed to be developer-friendly, making it easy to develop and send emails effortlessly.
Here's the most basic example of how easy it is to send an email directly with the Resend API:
$resend = Resend::client('re_123456789'); $resend->emails->send([ 'from' => 'from@example.com', 'to' => 'to@example.com', 'subject' => 'hello world', 'html' => '<strong>it works!</strong>',]);
The Laravel version has a facade you can use to email directly with the API, or you can integrate it as a mailer:
// Using the APIResend::email()->send([ 'from' => 'from@example.com', 'to' => $request->user()->email, 'subject' => 'hello world', 'html' => (new OrderShipped($order))->render(),]); // Via the Mail facadeMail::to($request->user())->send(new OrderShipped($order));
If you'd like to see more examples, there is a example repo for Laravel and a vanilla PHP example. The official docs have everything you need to set up Resend in Laravel along with the API reference docs.