Skip to content
Advertisement

I’m having an error while trying to use javax mail dependency

I’m trying to use javax mail in my project. I have enabled less secure apps in Gmail and made an inbound rule to unlock the port 465.

This the configuration which I use in application properties.

JavaScript

Allowing the port:
Allowing the port

I found on web that the port 465 needs to be unlocked, found a quick guide how to do that, you can see in the photo.

In the controller class I have set after the user is introducing his register credentials ( username , email address) to generate an email with a link to the edit profile page.

When I enter the username and mail and click submit I get the error

“Unknown SMTP host: smtp.hmail.com;”,

but the data is sent to the DB. I get error 500 on the web page.

JavaScript

Here I have the mail constructor class.

JavaScript

The error which I get in console is:

JavaScript

Advertisement

Answer

Your setup seems to be valid except of this

JavaScript

Seems like there is a typo related to the host name. I believe it should be

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement