[PHP SDK]
Laravel
Send mail from Laravel controllers, jobs, and notifications using the PHP SDK.
1
Install the PHP package
bash
composer require reloop/reloop-email2
Send email from Laravel
send_email.php
1<?php2
3use Reloop\Reloop;4use Illuminate\Http\Request;5
6class MailController7{8 public function send(Request $request)9 {10 $reloop = Reloop::client(env('RELOOP_API_KEY'));11
12 $email = $reloop->emails->send([13 'from' => 'Acme <onboarding@yourdomain.com>',14 'to' => [$request->input('to')],15 'subject' => 'Hello from Laravel',16 'html' => '<strong>It works!</strong>',17 ]);18
19 return response()->json(['id' => $email->id]);20 }21}3
GitHub, examples, and API reference
4
Need more help?
- Need help? Contact Support.
- Chat with Reloop developers on Discord.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.
Send with Laravel.
Get an API key and ship transactional email from Laravel using the official PHP SDK.