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>sh.nextmail</groupId>    <artifactId>nextmail</artifactId>    <version>0.1.1</version></dependency>
SendEmail.java
import java.util.Map;import sh.nextmail.Body;import sh.nextmail.Nextmail; public final class SendEmail {    public static void main(String[] args) {        Nextmail client = new Nextmail();         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.

Give it an address.
Watch it work.

MCP, the API and the command line come with every plan, the free one included. Connect a client and approve exactly what it reaches.

Read https://nextmail.sh/agent.md and follow it. Then tell me what I need to do to sign you in to my Nextmail mailbox. If I have no account yet, create one with my address and ask me for the code that arrives. Wait for my go-ahead before you send anything.

© 2026 Nextmail. All rights reserved.