How to Configure Email Notification in Jenkins

Pradeep Gopalgowda
3 min readSep 18, 2018

My next few blogs will be related to Jenkins, Docker and Kubernetes.

FYI, Same tutorial is available in youtube.

Setup Jenkins in Docker and open Jenkins using the following URL: http://localhost:8080/ on any browser and follow the below steps to configure Email Notification.

Click the ‘Manage Jenkins’ menu option displayed at the right side of the screen. You will be redirected to the ‘Manage Jenkins’ page, where you need to select the ‘Manage Plugin’ option.

Click the ‘Available’ tab present at the top of the ‘Manage Plugin’ page.

Type ‘Notification’ in the ‘Filter’ field displayed at the top-right side of the ‘Manage Plugin’ page. Click the checkbox next to the ‘Email-ext plugin’ option and ‘Email-ext Template Plugin’ option. Click the ‘Install without restart’ button.

Jenkins Plugin Manager

Go to the Jenkins home page and click the ‘Manage Jenkins’ menu option. Then, select the ‘Configure System’ option.

Enter the SMTP server name under ‘Email Notification’. Click the ‘Advanced’ button and then click the checkbox next to the ‘Use SMTP Authentication’ option. Now, set the following fields.

  • SMTP server name : smtp.gmail.com
  • User name: user_email_id@gmail.com
  • Password: 123456
  • Use SSL : Checked
  • SMTP Port: 465
Configuration for E-mail Notification

Check the email notification functionality by clicking the checkbox next to the ‘Test configuration by sending Test e-mail recipient’ option. Enter a valid email id and click the ‘Test configuration’ button to check whether the email id is valid or not.

Similarly enter the SMTP server name under ‘Extended Email Notification’. Click the ‘Advanced’ button and then click the checkbox next to the ‘Use SMTP Authentication’ option. Now, set the following fields

  • SMTP server name : smtp.gmail.com
  • User name: user_email_id@gmail.com
  • Password: 123456
  • Use SSL : Checked
  • SMTP Port: 465
Configuration for Extended E-mail Notification

Go to the home page and click on a New Item to create a Freestyle Jenkins Project.

Freestyle Project

Then, Click the ‘Add post-build action’ drop-down and select the ‘E-mail Notification’ value. Enter the recipient email id in the ‘E-mail Notification’ box and select the checkbox next to the ‘Send e-mail for every unstable build’ option.

Post-build Actions

Click the ‘Add post-build action’ drop-down and select the ‘Editable Email Notification’ value. Then fill the

  • Project Recipient List : email_id@gmail.com

Click the ‘Advance Settings…’ button in the ‘Editable Email Notification’ box. Click the ‘Add Trigger’ drop-down and select the ‘Always’ option and Click the ‘Save’ button.

Post-build Actions

Go to Email-Notification Jenkins job and click on Build now.

Console Output

Check the Recipient’s mail box.

Inbox

You can go through the Video Tutorial also :) Cheers!

--

--