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
- Package:
@euromail/sdkon npm - Source: github.com/kalle-works/euromail-typescript
npm install @euromail/sdkimport { 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
- Package:
euromailon PyPI - Source: github.com/kalle-works/euromail-python
pip install euromailimport 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
- Package:
euromail/euromail-phpon Packagist - Source: github.com/kalle-works/euromail-php
composer require euromail/euromail-phpuse 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
- Crate:
euromailon crates.io - Source: github.com/kalle-works/euromail-rust
cargo add euromailuse 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-goclient := 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.