JHipster新用户注册 - > MailConnectException

时间:2017-12-05 08:44:33

标签: spring exception jhipster user-registration mail-sender

我越来越了解JHipster和Spring但我在注册新用户时遇到了问题。当我尝试注册新用户时,我收到以下错误消息。根据此Stackoverflow问题Email service in Jhipster,我必须填写application-dev.yml或application-prod.yml中的属性。

网络应用程序应该来自不同的人,他们应该能够自我注册。我不认为这是正确的方法吗?我在这里错过了什么吗?我需要SMTP服务器吗?

2017-12-05 09:19:58.006  WARN 31208 --- [irpd-Executor-2] irpd.service.MailService                 : Email could not be sent to user 'test.test@gmail.com'

org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
  nested exception is:
    java.net.ConnectException: Connection refused: connect. Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
  nested exception is:
    java.net.ConnectException: Connection refused: connect

我的application-dev.yaml中有以下条目:

 mail:
        host: localhost
        port: 25
        username:
        password:
    messages:
        cache-seconds: 1
    thymeleaf:
        cache: false
    http:
        multipart:
            max-file-size: 5MB
            max-request-size: 20MB

1 个答案:

答案 0 :(得分:0)

是的,您需要一个SMTP服务器。查看我们在www.jhipster.tech上的提示部分,您会找到how to configure emailhow to use MailDev with Docker