问题
I'm new to Jhispter and I created an application using the yeoman generator
for Jhipster.
When I logged as an admin to this application to check the Health checks
section I noticed that email service is down and the details says this :
com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1
How can I solve this problem ?
回答1:
You must fill properties in application-dev.yml or application-prod.yml with your real account data (eg gmail account)
mail:
host: localhost
port: 25
username:
password:
Sample file: https://github.com/jhipster/jhipster-sample-app-token/blob/master/src/main/resources/config/application-dev.yml
回答2:
Go to application-prod.yml and add config below to fix it.
spring:
mail:
host: smtp.gmail.com
port: 587
user: your gmail address
password: your password
protocol: smtp
tls: true
auth: true
from: spoonatte@gmail.com
properties.mail.smtp:
auth: true
starttls.enable: true
ssl.trust: smtp.gmail.com
OR in application-prod.yml
mail:
host: smtp.gmail.com
port: 587
username: your gmail address
password: your password
protocol: smtp
tls: true
properties.mail.smtp:
auth: true
starttls.enable: true
ssl.trust: smtp.gmail.com
messages:
cache-seconds: 1
thymeleaf:
cache: false
来源:https://stackoverflow.com/questions/35956976/email-service-in-jhipster