Ritto Mail Docs

SDKs

Use the official Resend SDKs with Ritto Mail — the API is wire-compatible.

Ritto Mail has no SDKs of its own. Its REST API is wire-compatible with Resend's, so the official Resend SDKs work as they are: point them at Ritto Mail's base URL and authenticate with a Ritto Mail API key (rm_...). Nothing else changes — same methods, same request and response shapes.

Base URL

https://api.ritto.email — what every example on this page uses.

Most SDKs read the base URL from the RESEND_BASE_URL environment variable and the key from RESEND_API_KEY, so in most apps the switch is two environment lines:

RESEND_API_KEY=rm_...
RESEND_BASE_URL=https://api.ritto.email

The exceptions are noted per language below: Python reads RESEND_API_URL instead, and Java, .NET and Elixir take the base URL as a client option.

Node.js / TypeScript

resend on npm. Reads RESEND_BASE_URL; the constructor also accepts a baseUrl option.

npm install resend
import { Resend } from "resend";

const resend = new Resend("rm_123", { baseUrl: "https://api.ritto.email" });

const { data, error } = await resend.emails.send({
  from: "Acme <onboarding@acme.dev>",
  to: "delivered@example.com",
  subject: "Hello from Ritto Mail",
  html: "<strong>It works!</strong>",
});

Python

resend on PyPI. Reads RESEND_API_URL (not RESEND_BASE_URL), or set resend.api_url.

pip install resend
import resend

resend.api_key = "rm_123"
resend.api_url = "https://api.ritto.email"

email = resend.Emails.send({
    "from": "Acme <onboarding@acme.dev>",
    "to": "delivered@example.com",
    "subject": "Hello from Ritto Mail",
    "html": "<strong>It works!</strong>",
})

Go

resend-go. Reads RESEND_BASE_URL when the package loads, so set it in the process environment.

go get github.com/resend/resend-go/v4
// RESEND_BASE_URL=https://api.ritto.email
client := resend.NewClient("rm_123")

sent, err := client.Emails.Send(&resend.SendEmailRequest{
    From:    "Acme <onboarding@acme.dev>",
    To:      []string{"delivered@example.com"},
    Subject: "Hello from Ritto Mail",
    Html:    "<strong>It works!</strong>",
})

Ruby

resend on RubyGems. Reads RESEND_BASE_URL when the gem loads, so set it in the process environment.

gem install resend
# RESEND_BASE_URL=https://api.ritto.email
require "resend"

Resend.api_key = "rm_123"

email = Resend::Emails.send({
  from: "Acme <onboarding@acme.dev>",
  to: "delivered@example.com",
  subject: "Hello from Ritto Mail",
  html: "<strong>It works!</strong>"
})

PHP

resend/resend-php on Packagist. Reads RESEND_BASE_URL.

composer require resend/resend-php
// RESEND_BASE_URL=https://api.ritto.email
$resend = Resend::client('rm_123');

$email = $resend->emails->send([
    'from' => 'Acme <onboarding@acme.dev>',
    'to' => 'delivered@example.com',
    'subject' => 'Hello from Ritto Mail',
    'html' => '<strong>It works!</strong>',
]);

Rust

resend-rs on crates.io. Reads RESEND_BASE_URL; ConfigBuilder::base_url sets it in code.

cargo add resend-rs tokio -F tokio/macros,tokio/rt-multi-thread
// RESEND_BASE_URL=https://api.ritto.email
use resend_rs::types::CreateEmailBaseOptions;
use resend_rs::Resend;

let resend = Resend::new("rm_123");

let email = CreateEmailBaseOptions::new(
    "Acme <onboarding@acme.dev>",
    ["delivered@example.com"],
    "Hello from Ritto Mail",
)
.with_html("<strong>It works!</strong>");

let sent = resend.emails.send(email).await?;

Java

com.resend:resend-java on Maven Central. Takes the base URL through the builder.

<dependency>
  <groupId>com.resend</groupId>
  <artifactId>resend-java</artifactId>
  <version><!-- latest --></version>
</dependency>
Resend resend = Resend.builder()
    .apiKey("rm_123")
    .baseUrl("https://api.ritto.email")
    .build();

CreateEmailResponse sent = resend.emails().send(
    CreateEmailOptions.builder()
        .from("Acme <onboarding@acme.dev>")
        .to("delivered@example.com")
        .subject("Hello from Ritto Mail")
        .html("<strong>It works!</strong>")
        .build());

.NET

Resend on NuGet. Takes the base URL through ResendClientOptions.ApiUrl (also with AddResend in dependency injection).

dotnet add package Resend
using Resend;

IResend resend = ResendClient.Create(new ResendClientOptions
{
    ApiToken = "rm_123",
    ApiUrl = "https://api.ritto.email",
});

var res = await resend.EmailSendAsync(new EmailMessage
{
    From = "Acme <onboarding@acme.dev>",
    To = "delivered@example.com",
    Subject = "Hello from Ritto Mail",
    HtmlBody = "<strong>It works!</strong>",
});

Elixir

resend on Hex. Takes the base URL through the client config.

# mix.exs
def deps do
  [{:resend, "~> 0.4"}]
end
config :resend, Resend.Client,
  api_key: System.get_env("RESEND_API_KEY"),
  base_url: "https://api.ritto.email"

{:ok, email} =
  Resend.Emails.send(%{
    from: "Acme <onboarding@acme.dev>",
    to: "delivered@example.com",
    subject: "Hello from Ritto Mail",
    html: "<strong>It works!</strong>"
  })

Resend is a registered trademark of Plus Five Five, Inc. Ritto Mail is not affiliated with or endorsed by Resend.

On this page