Keycloak Email(SMTP) configuration

Ramanamuttana
2 min readSep 20, 2023

--

Requirements: Mailhog ,Keycloak (running)

  1. Mailhog :

Download the Mailhog from the below github page, go to the URL and download the version for your operating system.

Mailhog

Run the Mailhog first and we can see the following output on console in windows operating system, SMTP is running on localhost with port number :1025 and serving on localhost:8025

Mailhog running on port 1025 and serving on 8025

2. Let us go to Keycloak and login via admin and go to Realm that you want to set the email and then click on the Realm settings → Email we can see fields to set but before that we need set the email address for admin ,

configure the email address for the admin

So go to users →select admin → and add Email and click Save button

add admin email

Now add the following details. Realm settings → Email

Description of field values
Email

Click Save and click on the Test the connection Button , now we get an email from info@example.de to admin@example.com , we can see this on browser by entering the mailhog serving host address which is localhost:8025

Mailhog on chrome browser

Details are configured in email tab , That’s it .

--

--