If you configure email notification on Jenkins, Jenkins will notify us about the status of each build via email. Jenkins email notification is a convenient way to track the status of builds. If you configure email notification on Jenkins, you do not need to wait for the build’s results in the Jenkins dashboard results. In this tutorial, we see whether Jenkins Email Notification works and how we can configure Jenkins Email Notification if it does not work.
3 Steps For Jenkins Email Notification
- Test if Jenkins can send emails by sending a test email. If the email was not sent successfully and the Jenkins email notifications is not working as expected, SMTP server is not configured well.
- If you already have an SMTP server you want to use, get the settings such as machine address and port, user name, password, and whether the SMTP server supports SSL. If you do not have an SMTP server, you can install the SMTP server on the Jenkins machine.
- Set the settings of the SMTP Server For Jenkins Email Notification. After updating the settings, send a test email again and verify that it was successfully.
Testing Jenkins Email Notification
First, let’s see how to check if Jenkins can send emails successfully:

Testing Jenkins Email Notification
Set Who Send the emails

First, we need to set the admin user who send us the emails and its email address. Go to to Manage Jenkins > Configure System
. In the Configure System | Jenkins Location
fill System Admin e-mail address
. The format should be name <email>
for example Jenkins <admin@my-jenkines.com>
.
Send Test Email

Now, Go to Manage Jenkins > Configure System
. In the Configure System | E-mail Notification
, Check Test configuration by sending test e-mail
checkbox.
A "Test e-mail recipient"
text box should appear, Insert an email address to an account you can access. Finally, Press the Test Configuration
button. Email was successfully sent
appears.
Now, It is time to check that you have received the email.
Check If You Have Received The Email.

Login your the email account you specified in the previous step. Check if you have an email from the email admin you set in step 1 in your inbox (also check your spam folder). The title of the email should be something like ‘Test email #1’
If you find the email , Jenkins can sent emails successfully. Otherwise, see the how to configure your SMTP server.
Install local SMTP server For Jenkins Email Notification
By default, Jenkins will send emails via the default SMTP server (normally running on localhost). If you do not have an SMTP server already you want to use, you can install SMTP server in your Jenkins machine. To do so, Install mailutils
package that provides a SMTP server.
Install SMTP server by installing mailutils package
root@jenkins:~# ssh my-jenkins
login as: root
Authenticating with public key "rsa-key_2016-08-01-jenkins"
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-34-generic x86_64)
...
root@jenkins:~# apt-get install mailutils
...
Set SMTP Server For Jenkins Email Notification
Now, Go to Manage Jenkins > Configure System
. In the Configure System | E-mail Notification
and click Advanced
button.

Enter your details of your SMTP server:
SMTP server
is the domain of the machine. Leave empty for localhost- Check
Use SMTP Authentication
if the server requires authentication and then provideUser Name
andPassword
- Check
use SSL
if server requires SSL connection. - Provide
SMTP port
if the port number for the mail server. Leave empty for the default one (25 for simple connection, 465 for SSL connection).