spring - Possible causes of org.springframework.mail.MailSendException / java.net.ConnectException? -
i have spring boot application once day should send emails users needs informed specific events day. i'm using spring-boot-starter-mail dependency , javamailsender provided it. my application.proiperties config mails looks (with proper host, user , password data ofcourse): spring.mail.host = myhost.com spring.mail.username = user@myhost.com spring.mail.password = mypassword spring.mail.port = 25 spring.mail.properties.mail.smtp.auth = true and code responsible sending mails is: private void sendmessage(string email, string text, string subject) { try { mimemessage message = javamailsender.createmimemessage(); mimemessagehelper helper = new mimemessagehelper(message, true); helper.setfrom(sender); helper.setsubject(subject); helper.setto(email); helper.settext(text, true); javamailsender.send(message); } catch (messagingexception e) { e.printstacktrace(); } catch (mailexception e) { ...