Email service in Jhipster

喜夏-厌秋 提交于 2019-12-23 05:26:09

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!