Email API

Send transactional email from Java with the OquMail API

A runnable Java example that sends email through OquMail: the endpoint, the auth header, and where to keep your key. Practical guide for non-technical small…

If your Java app sends receipts, welcome emails, or alerts, you can push them through OquMail with one HTTPS POST — from your own domain, on the free plan. Here is a working Java example and the things that trip people up.

Quick summary

  • POST https://API (a way for your app or website to send email automatically).oqumail.com/api/v1/emails
  • Header: Authorization: Bearer YOUR_API_KEY
  • JSON body: from, to, subject, and html (or text)
  • Your sending domain must be verified in OquMail (SPF/DKIM/DMARC green).
  • The "from" address must be on that verified domain.

The endpoint

  • POST https://API (a way for your app or website to send email automatically).oqumail.com/api/v1/emails
  • Header: Authorization: Bearer YOUR_API_KEY
  • JSON body: from, to, subject, and html (or text)

Java example

Paste this into your Java code and swap in your domain and key:

var body = """
{"from":"hello@yourdomain.com","to":"customer@example.com","subject":"Welcome","html":"<p>Thanks.</p>"}""";
var req = HttpRequest.newBuilder(URI.create("https://api.oqumail.com/api/v1/emails"))
  .header("Authorization", "Bearer " + apiKey)
  .header("Content-Type", "application/json")
  .POST(HttpRequest.BodyPublishers.ofString(body)).build();
HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());

Java tip

java.net.http.HttpClient (Java 11+) needs no external dependency.

Before it works

  • Your sending domain must be verified in OquMail (SPF/DKIM/DMARC green).
  • The "from" address must be on that verified domain.
  • Create an API key in the OquMail dashboard; treat it like a password.
  • Keep a normal mailbox on the same domain so customer replies reach a human.

Common questions

How long does send transactional email from java with the oqumail api take for a small business?

Most teams finish domain connection and first mailboxes in under an hour. DNS propagation is often minutes; in rare cases wait up to 24–48 hours. OquMail shows live verification so you know when you are ready.

Do I need technical experience to set up business email?

No. If you can log into where you bought your domain and paste a few lines of text, you can set up professional email. OquMail guides you step by step and verifies when DNS is correct.

Can my small team use business email for free?

Yes. OquMail's free plan includes up to 15 mailboxes on your own domain with webmail, guided SPF/DKIM/DMARC setup, and a transactional email API — no credit card required.

Free business email on your own domain

OquMail gives you up to 15 mailboxes on your domain — free — with guided SPF/DKIM/DMARC, webmail, IMAP/SMTP for any mail app, and a send API. Most teams are live in under fifteen minutes. Start at oqumail.com.

Get started free

Ready for business email on your domain?

Up to 15 free mailboxes, guided DNS, webmail, and a transactional API — start in minutes.

Create your free workspace