PHP
Official MailsSetu PHP SDK. Works with PHP 8.0+.
Installation
bash
composer require mailsetu/mailsetuSetup
php
<?php
require_once 'vendor/autoload.php';
$client = new MailSetu\MailSetu(getenv('MAILSETU_API_KEY'));Send an email
php
$response = $client->emails()->send([
'from' => 'Acme <noreply@acme.co>',
'to' => ['user@example.com'],
'subject' => 'Welcome to Acme!',
'html' => '<h1>Welcome!</h1>',
]);
echo $response['id']; // email-xxxxxxxxxxxxxxxx
echo $response['status']; // queued