Learn how to send your first email using the Resend Java SDK.
implementation 'com.resend:resend-java:3.1.0'
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(); } } }
Was this page helpful?