SDKs

Official SDKs

Every SDK listed here matches the production MailsSetu surface for email sends, templates, inbound workflows, webhooks, and operational tooling. We only show packages and integrations that are actually maintained in this codebase.

Node.js / TypeScriptv0.2.6 · stable
mailsetu
Install
npm install mailsetu
Features
  • Full TypeScript types
  • Email, inbound, and webhook support
  • Auto-retry with backoff
  • ESM + CJS
Send your first email
import { MailSetu } from 'mailsetu'

const client = new MailSetu({ apiKey: process.env.MAILSETU_API_KEY })

const result = await client.emails.send({
  from: 'you@yourdomain.com',
  to: ['user@example.com'],
  subject: 'Hello from MailsSetu!',
  html: '<p>Works great.</p>',
})

console.log(result.id) // em_01HXYZ
Pythonv0.2.6 · stable
mailsetu
Install
pip install mailsetu
Features
  • Python 3.9+
  • Email, inbound, and webhook resources
  • Timeouts and retries
  • JSON-first API
Send your first email
from mailsetu import MailSetu
import os

client = MailSetu(os.environ["MAILSETU_API_KEY"])

result = client.emails.send(
    from_="you@yourdomain.com",
    to=["user@example.com"],
    subject="Hello from MailsSetu!",
    html="<p>Works great.</p>",
)

print(result["id"])  # em_01HXYZ
PHPv0.2.6 · stable
mailsetu/mailsetu
Install
composer require mailsetu/mailsetu
Features
  • PHP 8.1+
  • Email, inbound, and webhook resources
  • Composer-ready manifest
  • JSON-first API
Send your first email
use MailSetu\MailSetu;

$client = new MailSetu($_ENV['MAILSETU_API_KEY']);

$result = $client->emails()->send([
    'from'    => 'you@yourdomain.com',
    'to'      => ['user@example.com'],
    'subject' => 'Hello from MailsSetu!',
    'html'    => '<p>Works great.</p>',
]);

echo $result['id']; // em_01HXYZ
Gov0.2.6 · stable
github.com/mailsetu/mailsetu-go
Install
go get github.com/mailsetu/mailsetu-go
Features
  • Go 1.21+
  • Email, inbound, and webhook services
  • Retry-safe HTTP client
  • Zero external deps
Send your first email
import "github.com/mailsetu/mailsetu-go"

client := mailsetu.New(os.Getenv("MAILSETU_API_KEY"), "")

result, err := client.Emails.Send(mailsetu.SendEmailRequest{
    From:    "you@yourdomain.com",
    To:      []string{"user@example.com"},
    Subject: "Hello from MailsSetu!",
    HTML:    "<p>Works great.</p>",
})

fmt.Println(result.ID) // em_01HXYZ
Javav0.2.6 · stable
in.mailsetu:mailsetu-java
Install
<dependency>
  <groupId>in.mailsetu</groupId>
  <artifactId>mailsetu-java</artifactId>
  <version>0.2.6</version>
</dependency>
Features
  • Java 11+
  • Email, inbound, and webhook resources
  • Maven-ready project file
  • No external JSON dependency
Send your first email
import in.mailsetu.MailSetu;
import java.util.List;
import java.util.Map;

MailSetu client = new MailSetu(System.getenv("MAILSETU_API_KEY"));

String result = client.emails().send(Map.of(
    "from", "you@yourdomain.com",
    "to", List.of("user@example.com"),
    "subject", "Hello from MailsSetu!",
    "html", "<p>Works great.</p>"
));
    System.out.println(result);
Rubyv0.2.6 · stable
mailsetu
Install
gem install mailsetu
Features
  • Ruby 2.6+
  • Email, inbound, and webhook resources
  • Retry-safe Net::HTTP client
  • Rails-friendly API
Send your first email
require "mailsetu"

client = MailSetu::Client.new(api_key: ENV.fetch("MAILSETU_API_KEY"))

result = client.emails.send(
  from: "you@yourdomain.com",
  to: ["user@example.com"],
  subject: "Hello from MailsSetu!",
  html: "<p>Works great.</p>"
)

puts result["id"]
.NETv0.2.6 · stable
MailSetu
Install
dotnet add package MailSetu
Features
  • .NET 6+ and .NET 8
  • Email, inbound, and webhook resources
  • HttpClient-based retries
  • ASP.NET-friendly integration
Send your first email
using MailSetu;

var client = new MailSetuClient(
    Environment.GetEnvironmentVariable("MAILSETU_API_KEY")!
);

var result = await client.Emails.SendAsync(new Dictionary<string, object?>
{
    ["from"] = "you@yourdomain.com",
    ["to"] = new[] { "user@example.com" },
    ["subject"] = "Hello from MailsSetu!",
    ["html"] = "<p>Works great.</p>"
});

Console.WriteLine(result.GetProperty("id").GetString());
WordPress Pluginv0.2.6 · stable
integrations/wordpress/mailsetu-wordpress.php
Install
Drop the plugin into your WordPress install and configure your MailsSetu API key.
Features
  • Settings page
  • Test email flow
  • wp_mail interception
  • MailsSetu launch-ready setup
Send your first email
// Configure in WordPress admin:
// Settings → MailSetu
//
// Add:
// - your API key
// - from address
// - from name
//
// Then send a test email from the plugin settings page.

Why use an official SDK?

You can always call the REST API directly — but the SDK saves real time.

Auto-retry with backoff
Transient network errors and 429s are retried automatically with exponential backoff. Your code doesn't need retry logic.
Type safety
Catch typos and wrong parameters at build time, not at 2 AM when your welcome email isn't sending.
Idiomatic code
Each SDK follows the conventions of its language — async/await in JS, context in Go, builders in Java.

Ready to integrate?

Pick your language above and follow the guide. You'll be sending in 5 minutes.