Official Java SDK for the SendKit email API.
- Java 11+
<dependency>
<groupId>dev.sendkit</groupId>
<artifactId>sendkit</artifactId>
<version>1.0.0</version>
</dependency>implementation 'dev.sendkit:sendkit:1.0.0'import dev.sendkit.SendKit;
import dev.sendkit.Emails;
import java.util.List;
SendKit client = new SendKit("your-api-key");
// Send an email
Emails.SendEmailResponse response = client.emails().send(
new Emails.SendEmailParams("from@example.com", List.of("to@example.com"), "Hello")
.html("<p>Hello world!</p>")
.text("Hello world!")
);
System.out.println("Email sent: " + response.getId());Emails.SendEmailResponse response = client.emails().send(
new Emails.SendEmailParams("from@example.com", List.of("to@example.com"), "Hello")
.html("<p>Hello!</p>")
.cc(List.of("cc@example.com"))
.bcc(List.of("bcc@example.com"))
.replyTo("reply@example.com")
.tags(List.of("welcome"))
.scheduledAt("2025-01-01T00:00:00Z")
.attachments(List.of(
new Emails.Attachment("file.pdf", "base64content")
.contentType("application/pdf")
))
);Emails.SendMimeEmailResponse response = client.emails().sendMime(
new Emails.SendMimeEmailParams("from@example.com", "to@example.com", rawMimeString)
);try {
client.emails().send(params);
} catch (SendKitException e) {
System.out.println(e.getMessage()); // "Invalid email"
System.out.println(e.getName()); // "validation_error"
System.out.println(e.getStatusCode()); // 422
}MIT