Skip to main content

Prerequisites

To get the most out of this guide, you’ll need to:
You can find your API keys in your SendPost Dashboard. Make sure to use your Sub-Account API Key for sending emails.

1. Install

Check Maven Central for the latest version.

Maven Setup

Option 1: Standard Maven Project

Add this dependency to your pom.xml:
POM

Option 2: Spring Boot with Maven

Add to your pom.xml:
POM

Gradle Setup

Option 1: Standard Gradle Project

Add to your build.gradle:
Gradle

Option 2: Spring Boot with Gradle

Add to your build.gradle:
Gradle

Option 3: Gradle with Kotlin DSL

Add to your build.gradle.kts:
Kotlin

2. Getting Started

Basic Example

Java

Maven Project Structure

Run with Maven:

Gradle Project Structure

Run with Gradle:
Or add to build.gradle:
Gradle
Then run:

3. Common Use Cases

Welcome Email

Java

Password Reset Email

Java

4. Spring Boot Integration

Create Email Service

Java

Add Configuration

Add to application.properties:
Or application.yml:

Use in Controller

Java
Make sure your sender email domain is verified in your SendPost account before sending emails.

5. Next Steps

Explore more examples and use cases:

Java SDK

View the official SDK on GitHub

SDK Examples

Comprehensive email sending examples

ESP Workflow Example

Full-featured example app with comprehensive ESP workflow