Hello there
can someone explain me how to inject mail properties defined unders config/MailConfig.java
I have an application.properties file generated with my mail.* properties in my target folder
but it does seem to be injected in the @Value("#{environment['mail.*']}") parameters
here is the piece of code inquestion
PHP Code:
@Configuration
public class MailConfig {
@Bean
public JavaMailSender mailSender(@Value("#{environment['mail.host']?:'localhost'}") String host,
@Value("#{environment['mail.port']?:25}") int port,
@Value("#{environment['mail.username']}") String username,
@Value("#{environment['mail.password']}") String password,
@Value("#{environment['mail.smtp.auth']?:false}") boolean mailSmtpAuth,
@Value("#{environment['mail.smtp.starttls.enable']?:false}") boolean mailSmtpStartTls) {
...
}
}
Thanks for your help