[Java SDK]
Spring Boot
Integrate Reloop into Spring Boot services with the Java SDK—Maven or Gradle ready.
1
Install the Java package
bash
sh.reloop:reloop-email2
Send email from Spring Boot
send_email.java
1import org.springframework.web.bind.annotation.*;2import sh.reloop.email.ReloopEmail;3import sh.reloop.email.model.SendEmailRequest;4
5@RestController6public class MailController {7 private final ReloopEmail reloop =8 ReloopEmail.client(System.getenv("RELOOP_API_KEY"));9
10 @PostMapping("/send")11 public Map<String, String> send(@RequestBody Map<String, String> body)12 throws Exception {13 var email = reloop.emails().send(14 SendEmailRequest.builder()15 .from("Acme <onboarding@yourdomain.com>")16 .to(body.get("to"))17 .subject("Hello from Spring Boot")18 .html("<strong>It works!</strong>")19 .build()20 );21 return Map.of("id", email.getId());22 }23}3
GitHub, examples, and API reference
4
Need more help?
- Need help? Contact Support.
- Chat with Reloop developers on Discord.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.
Send with Spring Boot.
Get an API key and ship transactional email from Spring Boot using the official Java SDK.