JHipster new User Registration -> MailConnectException

789 Views Asked by At

I am getting to know JHipster and Spring better and better but I have an issue with registrating a new User. When I try to register a new User I receive the below error message. According to this Stackoverflow issue Email service in Jhipster I have to fill in the properties in application-dev.yml or application-prod.yml.

The web-app should be used from different persons, who should be able to register themselves. I don't think that this is the correct way to go? Am I missing something here? Do I need a SMTP Server for this to work?

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

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

I have the following entry in my 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

There are 1 best solutions below

0
On

Yes you need an SMTP server. Check our tips section on www.jhipster.tech, you'll find how to configure email and how to use MailDev with Docker