Learn how to send your first email using the Resend Java SDK.
To get the most out of this guide, you’ll need to:
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(); } } }
See the full source code.
Was this page helpful?