Java SDK
The official Render25 Java client library. Compatible with Java 11+, Spring Boot, Android, and Quarkus with zero third-party dependencies.
Java 11+ & 17 / 21Maven & GradleZero Dependencies
Installation
Maven
pom.xml
<dependency>
<groupId>com.render25</groupId>
<artifactId>render25-sdk</artifactId>
<version>1.0.0</version>
</dependency>Gradle
groovy
implementation 'com.render25:render25-sdk:1.0.0'Basic Usage
Initialize the client. It automatically detects RENDER25_API_KEY from environment variables.
Main.java
import com.render25.Render25;
import com.render25.Render25.EmailOptions;
import com.render25.Render25.SendResponse;
public class Main {
public static void main(String[] args) throws Exception {
// Reads RENDER25_API_KEY from environment automatically
Render25 render25 = new Render25();
SendResponse response = render25.emails().send(
new EmailOptions()
.from("support@yourdomain.com")
.to("customer@example.com")
.subject("Welcome to Render25!")
.html("<h1>Welcome aboard!</h1><p>Transactional email delivered via Java.</p>")
.text("Welcome aboard! Transactional email delivered via Java.")
);
System.out.println("Dispatched Message ID: " + response.id);
}
}Note
Set
RENDER25_API_KEY in your environment variables.CC, BCC & Custom Reply-To
Advanced.java
import com.render25.Render25;
import com.render25.Render25.EmailOptions;
public class Advanced {
public static void sendReceipt(Render25 client) throws Exception {
client.emails().send(
new EmailOptions()
.from("support@yourdomain.com")
.to("client@example.com")
.cc("accounting@example.com")
.bcc("archive@example.com")
.replyTo("helpdesk@yourdomain.com")
.subject("Invoice #1042 Ready")
.html("<p>Your invoice is ready for review.</p>")
);
}
}File Attachments
Pass file bytes with new Attachment("invoice.pdf", bytes, "application/pdf"):
Attachments.java
import com.render25.Render25;
import com.render25.Render25.Attachment;
import com.render25.Render25.EmailOptions;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Attachments {
public static void sendWithPdf(Render25 client) throws Exception {
byte[] pdfBytes = Files.readAllBytes(Paths.get("invoice.pdf"));
client.emails().send(
new EmailOptions()
.from("billing@yourdomain.com")
.to("client@example.com")
.subject("Your Invoice #1042")
.html("<p>Your receipt is attached below.</p>")
.attach(new Attachment("invoice_1042.pdf", pdfBytes, "application/pdf"))
);
}
}Spring Boot Integration
NotificationService.java
package com.example.service;
import com.render25.Render25;
import com.render25.Render25.EmailOptions;
import org.springframework.stereotype.Service;
@Service
public class NotificationService {
private final Render25 render25 = new Render25();
public void sendOrderConfirmation(String email, String orderId) throws Exception {
render25.emails().send(
new EmailOptions()
.from("orders@yourdomain.com")
.to(email)
.subject("Order #" + orderId + " Confirmed")
.html("<h1>Thank you for your order #" + orderId + "!</h1>")
);
}
}