@Bean
public JavaMailSender mailSender() {
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setDefaultEncoding("UTF-8");
mailSender.setHost("smtp.googlemail.com");
mailSender.setPort(465);
mailSender.setUsername("[email protected]");
mailSender.setPassword("XXXXXXXXXXXXXXX");
Properties properties = new Properties();
properties.put("mail.smtp.auth", true);
properties.put("mail.smtp.starttls.enable", true);
mailSender.setJavaMailProperties(properties);
return mailSender;
}
I am trying to send mail using javamailsender for that i configured the above code using annotations after that I get the "java.lang.NoClassDefFoundError: org/springframework/core/type/AnnotatedTypeMetadata" exception any suggestions appriciate.
It seems dependency spring-core is missing. You should add this jar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With