Skip to the documentation
Java

Java SDK

The official Java client for the Nextmail API. One artifact with no dependencies, and one method for every endpoint.

What it is

One artifact over the whole API, from sending, templates and tracking to threads, contacts, domains, webhooks and disposable inboxes. It has a method for every method of the TypeScript SDK under the same name, an exception class for every kind of refusal, retries that cannot duplicate a send, and a webhook signature verifier. It needs Java 17 or later and nothing else: requests go through java.net.http.HttpClient, and the JSON reader and writer are its own.

<dependency>    <groupId>uk.openemail</groupId>    <artifactId>openemail</artifactId>    <version>0.0.1</version></dependency>
SendEmail.java
import java.util.Map;import uk.openemail.Body;import uk.openemail.OpenEmail; public final class SendEmail {    public static void main(String[] args) {        OpenEmail client = new OpenEmail();         Map<String, Object> email = client.emails().send(Body.of(            "from", "Acme Billing <[email protected]>",            "to", "[email protected]",            "subject", "Your September invoice",            "html", "<p>Invoice attached.</p>"        ));         System.out.println(email.get("id") + " " + email.get("status"));    }}

Where to go

It wraps the same API as every other client

Everything here is the surface the API reference documents and the TypeScript SDK wraps, so read the API reference for what an endpoint does and this for how to call it from Java. Every TypeScript method has a Java twin, and the parity check of the package runs both with the same arguments and fails unless they send byte for byte the same request.