Skip to content

This is a simple spring application developed using Spring boot to demonstrate the integration of the Spring Mail module for sending emails using HTML templates.

Notifications You must be signed in to change notification settings

MaheshIare/spring-boot-mail-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-swagger-demo

This is a simple spring application developed using Spring boot to demonstrate the integration of Spring Mail module for sending emails using html templates. This application is integrated with Gmail SMTP server that sends email(s), so in order to send emails using your Gmail account we need to change the Gmail account settings to provide permissions for other apps to be integrated. More details on how to change gmail account settings, click here: Enable Less secure apps

Build

mvn clean install

Build status: Maven Package

Sonar status: SonarCloud

Description

Application consists of a POST API(/email) which accepts sender and receiver information in the request body which includes receiver email-id(s) for sending email(s). Dependencies to be added:

	<!-- Spring mail boot starter -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-mail</artifactId>
	</dependency>
	
	<!-- Thymeleaf dependency for html templates -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-thymeleaf</artifactId>
	</dependency>
		

Additional auto configuration to be added to application.properties file

### Email configuration ###
spring.mail.username=<gmail-id>
spring.mail.password=<password>
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.protocol=smtp
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.ssl.trust=smtp.gmail.com
spring.mail.properties.mail.smtp.starttls.enable=true

Contributing

Thanks much. Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

About

This is a simple spring application developed using Spring boot to demonstrate the integration of the Spring Mail module for sending emails using HTML templates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages