Skip to main content

Prerequisites

To get the most out of this guide, you’ll need to:

1. Install

implementation 'com.resend:resend-java:+'

2. Send emails using HTML

Main.java
import com.resend.*;

public class Main {
    public static void main(String[] args) {
        Resend resend = new Resend("re_xxxxxxxxx");

        CreateEmailOptions params = CreateEmailOptions.builder()
                .from("Acme <onboarding@resend.dev>")
                .to("delivered@resend.dev")
                .subject("it works!")
                .html("<strong>hello world</strong>")
                .build();

         try {
            CreateEmailResponse data = resend.emails().send(params);
            System.out.println(data.getId());
        } catch (ResendException e) {
            e.printStackTrace();
        }
    }
}

3. Try it yourself

Basic Send

Basic email sending

Attachments

Send emails with file attachments

Templates

Send emails using Resend hosted templates

Scheduling

Schedule emails for future delivery

Audiences

Manage contacts and audiences

Domains

Create and manage sending domains

Inbound Webhooks

Receive and process inbound emails

Double Opt-in

Double opt-in subscription flow

Javalin App

Full Javalin web framework application

Spring Boot App

Full Spring Boot application