← Back to docs

Official SDKs

Install and use the official EuroMail SDKs for TypeScript, Python, PHP, Rust, and Go.

Overview

EuroMail publishes official, typed SDKs for five languages. Each wraps the same REST API. Authentication, retries, and JSON handling are done for you, so you call methods instead of building HTTP requests. You can always fall back to plain HTTP (see Sending Emails) if your language is not listed.

All SDKs read your API key. Keep it in an environment variable, never in source.

TypeScript / JavaScript

npm install @euromail/sdk
import { EuroMail } from "@euromail/sdk";

const client = new EuroMail({ apiKey: process.env.EUROMAIL_API_KEY! });

await client.emails.send({
  from: "[email protected]",
  to: "[email protected]",
  subject: "Welcome aboard",
  html_body: "<h1>Welcome!</h1>",
  text_body: "Welcome!",
});

Python

pip install euromail
import os
from euromail import EuroMail

client = EuroMail(api_key=os.environ["EUROMAIL_API_KEY"])

client.emails.send(
    from_="[email protected]",
    to="[email protected]",
    subject="Welcome aboard",
    html_body="<h1>Welcome!</h1>",
    text_body="Welcome!",
)

PHP

composer require euromail/euromail-php
use EuroMail\Client;

$client = new Client(getenv('EUROMAIL_API_KEY'), [
    'max_retries' => 3,       // retry 429/5xx/transport failures; default 0 (no retries)
    'max_retry_delay' => 30,  // cap the wait between retries, in seconds; default 30
    // 'transport' => new MyPsr18Transport(), // inject your own EuroMail\Http\TransportInterface
]);

$sent = $client->emails->send([
    'from' => '[email protected]',
    'to' => '[email protected]',
    'subject' => 'Welcome aboard',
    'html_body' => '<h1>Welcome!</h1>',
    'text_body' => 'Welcome!',
]);

The constructor also takes base_url and timeout (seconds, default 15). By default it sends over cURL when ext-curl is loaded, falling back to PHP's stream wrapper otherwise -- pass your own transport (implementing EuroMail\Http\TransportInterface) to swap that out entirely, e.g. to route through an existing HTTP client or add logging.

Requires PHP 7.4+, with zero runtime dependencies beyond ext-json. Running WordPress instead? The Euromail plugin is built on this SDK and routes wp_mail() through it with no code required.

Rust

cargo add euromail
use euromail::Client;

let client = Client::from_env()?; // reads EUROMAIL_API_KEY

client.emails().send(
    euromail::SendEmail::new("[email protected]", "[email protected]", "Welcome aboard")
        .html_body("<h1>Welcome!</h1>")
        .text_body("Welcome!"),
).await?;

Go

go get github.com/kalle-works/euromail-go
client := euromail.NewClient(os.Getenv("EUROMAIL_API_KEY"))

_, err := client.Emails.Send(ctx, &euromail.SendEmail{
    From:     "[email protected]",
    To:       "[email protected]",
    Subject:  "Welcome aboard",
    HTMLBody: "<h1>Welcome!</h1>",
    TextBody: "Welcome!",
})

Choosing between an SDK and raw HTTP

The SDKs are the fastest path and handle the fiddly parts (auth headers, JSON, typed responses). Use raw HTTP when you need a language without an SDK, want zero dependencies, or are calling from a shell script or serverless edge runtime. The Sending Emails guide shows the equivalent curl for every operation.

For AI agents and assistants, also see the MCP server, which exposes EuroMail as tools an LLM can call directly.

Send your first email in about 90 seconds

The free tier includes 3,000 emails a month. All data stays in Finland | GDPR compliance without the paperwork.

Create free account See live delivery data