Amazon SES & Spring Boot Integration

In this article, I will show you the steps needed to send emails from a Boot Spring app using Amazon SES or any other SMTP service.Spring boot provides all the configuration of JavaMail by a single starter dependency. Add this following dependency to your spring boot pom.xml file.<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-mail</artifactId><version>2.2.5.RELEASE</version></dependency>Once the dependency is in place, the next step is to specify the AWS SES properties in the file using the spring.mail.* namespace.###################AWS SES<host>>
When you are trying this in your local or in a non-ssl or untrusted SSL server. You may get unable to connect to host exception. So add the last*This will ignore the ssl check.To get the host , username and password. Login to your AWS console and go to ses SMTP Settings and generate your credencial. Make a service class(SmtpService.Java) in your project and follow this sample code.@Service
public class SmtpService {

private JavaMailSender javaMailSender;
public void send(Request request){
SimpleMailMessage message = new SimpleMailMessage();
Create a sample Model for your email payload(Request.Java)private String to;
private String body;
private String from;
private String subject;
Now you can able to send emails. Find the comple project here
If you want to learn bulk email, email marketing and how to create your own email marketing system using open source stack, get this ebook I have covered all basics with step by step method.




Another DevSec Guy.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Project Euler #5: Smallest multiple — Hacker Rank Program

Dynamic Programming: “Memoization”

Milky Way

Automate Exploratory Testing in Android — Build your own crawler

TPS and Agile


Measurement Must Have A Purpose

Random-Access (Seekable) Streams for Amazon S3 in C#

Uploading files to Azure Blob Storage in PHP

Connection between C# and MYSQL

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Amaresh Pattanayak

Amaresh Pattanayak

Another DevSec Guy.

More from Medium

Java Libraries

Develop Bluetooth LE application easily with JAVA and BleuIO

Migrating from Mockito 1 to Mockito 2 on Java 11

Marshaling and Unmarshaling XML using JAXB