Configuring Java Mail

Initially, before using the Java Mail queue, the dependency and configuration classes need to be specified. The following Maven starter dependency needs to be included:

<dependencies>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
</dependencies>

The following configuration properties also need to be added to the application.properties file:

spring.mail.host=localhost
spring.mail.port=25
spring.mail.username=
spring.mail.password=

The spring.mail.host property will point to localhost, while spring.mail.port will point to the default SMTP port 25. The spring.mail.username and spring.mail.password are intentionally left blank because there won't be any authentication for SMTP server. These can be filled, if there are credentials for the SMTP server.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.190.182