-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
Keith Donald opened SPR-8322 and commented
e.g. would turn this:
@Bean
public JavaMailSender mailSender() {
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setDefaultEncoding("UTF-8");
mailSender.setHost(environment.getProperty("mail.host"));
Integer port = environment.getProperty("mail.port", Integer.class);
if (port != null) {
mailSender.setPort(port);
}
mailSender.setUsername(environment.getProperty("mail.username"));
mailSender.setPassword(environment.getProperty("mail.password"));
Properties properties = new Properties();
Boolean mailSmtpAuth = environment.getProperty("mail.smtp.auth", Boolean.class);
if (mailSmtpAuth != null) {
properties.put("mail.smtp.auth", mailSmtpAuth);
}
Boolean mailSmtpStartTls = environment.getProperty("mail.smtp.starttls.enable", Boolean.class);
if (mailSmtpAuth != null) {
properties.put("mail.smtp.auth", mailSmtpStartTls);
}
mailSender.setJavaMailProperties(properties);
return mailSender;
}
into this:
@Bean
public JavaMailSender mailSender() {
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setDefaultEncoding("UTF-8");
mailSender.setHost(environment.getProperty("mail.host"));
mailSender.setPort(port, environment.getProperty("mail.port", Integer.class, 25));
mailSender.setUsername(environment.getProperty("mail.username"));
mailSender.setPassword(environment.getProperty("mail.password"));
Properties properties = new Properties();
properties.put("mail.smtp.auth", environment.getProperty("mail.smtp.auth", Boolean.class, false));
properties.put("mail.smtp.auth", environment.getProperty("mail.smtp.starttls.enable", Boolean.class, false));
mailSender.setJavaMailProperties(properties);
return mailSender;
}
Attachments:
- mylyn-context.zip (40.51 kB)
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement