Following is my application.yml file
spring:
mail:
host: smtp.gmail.com
port: 587
In one of my Java classes, I want to use the port number, which annotation I can use to achieve the same.
CodePudding user response:
You can use the @Value annotation:
@Value("${spring.mail.port}")
private Integer port;
CodePudding user response:
@Value("${spring.mail.port}")
private String port;