img

Jenkins Email Notification

Continuous Integration is the major part of any large project. It’s always recommended whenever you’re working on the large project and even sometimes you need nightly build as well. Now talking about Continuous Integration, Jenkins is always coming first in anyone minds. Jenkins is one of the best CI tool currently in the market. There are two reasons for that. One of the reason is it’s an open source tool and everyone likes the open source tools. The second major thing in Jenkins is its plugins. You can connect Jenkins with any of your project tools you’re using. Jenkins has a large amount of plugin someone need. One of the main plugins Jenkins has is Email Notification plugin which sends you an email whenever its build complete. You can also configure when you want to receive mail, what would be recipients of the email, what content or reports you need to send with email if you need to send logs with mail etc.

Let’s look how to configure Jenkins Email plugin.

Pre Requisites :

  1. Jenkins (If you don’t have install from here)
  2. Email Ext plugin
Jenkins Email Configuration

  1. If you installed Jenkins, open Jenkins with URL – http://localhost:8080/ (Note: Port might be different). On start, it will display the login page to login. Log in with your valid credentials.

2. Now from Jenkins Dashboard, go to ‘Manage Jenkins’ from left side panel.

3. You’ll see screen something like below in Manage Jenkins.

i

4. Now click on ‘Manage Plugin’ from the screen to install the Email Ext plugin.

i

5. Click on the Available tab from the Manage Plugin screen and Search for ‘Email Ext’ plugin from the filter display on the right side above.

viii

6. Once you found the plugin, select it and click on ‘Download now and install after restart’ button. (You can also click on Install without restart but some plugins need Jenkins restart so it would better it restart always after plugin installed)

viii

7. After successfully installed, Jenkins will restart.

8. Now from the Jenkins Dashboard, go to Manage Jenkins again.

9. Open Configure System from there.

ix

10. Navigate to E-mail Notification on the screen.

x

11. Click on Advanced and enter below configuration details.

  • SMTP Server: smtp.gmail.com
  • Default Email Suffix: @gmail.com
  • Use SMTP Authentication: Check
  • User name: mail@gmail.com (Enter your email here)
  • Password:  qwerty (Enter your email password)
  • Use SSL: Check
  • SMTP Port: 465

xi

12. Check on Test configuration by sending the test email and Enter email address.

13. Click on Test Configuration, it’ll send a test email to entered email id.

xiii

14. Click on Apply and Save button.

15. Now go to Jenkins dashboard and select Project –> Configure

16. Navigate to Add Post Build action and select Editable Email Notification.

ixv

17. Enter the Project recipient list whom you want to send this email.

xv

18. Click on ‘Advanced Settings’ and check Triggers section.

xvi

19. Click on Add Trigger and add trigger as per your need for the build.

xviu

xxvi

20. Click on Apply and Save.

21. Now run the build, on completion of build execution you’ll see the log of email sent to entered recipients and you’ll receive the email of the build as well.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.112s
[INFO] Finished at: Thu Aug 31 21:07:03 IST 2017
[INFO] Final Memory: 56M/255M
[INFO] ------------------------------------------------------------------------
channel stopped
Archiving artifacts
Email was triggered for: Always
Sending email for trigger: Always
Sending email to: step2qa@gmail.com
Finished: SUCCESS
  • Facebook
  • Twitter
  • Google+
  • Linkedin
  • Pinterest

1 Comments

Leave a Comment

Your email address will not be published. Required fields are marked *

It is main inner container footer text
Accessibility