Send emails with Spring by using Java annotations – Stack Overflow

Send emails with Spring by using Java annotations – Stack Overflow

@Configuration public class MailConfig { @Value”${email.host}” private String host; @Value”${email.port}” private Integer port; @Bean public JavaMailSender javaMailService { JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl; javaMailSender.setHosthost; javaMailSender.setPortport; javaMailSender.setJavaMailPropertiesgetMailProperties; return javaMailSender; } private Properties getMailProperties { Properties properties = new Properties; properties.setProperty”mail.transport.protocol”, “smtp”; properties.setProperty”mail.smtp.auth”, “false”; properties.setProperty”mail.smtp.starttls.enable”, “false”; properties.setProperty”mail.debug”, “false”; return properties; } }

via Send emails with Spring by using Java annotations – Stack Overflow.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s