Configure Jenkins Email Notification - part 2

SMTP server on localhost

By default, Jenkins will send emails via the default SMTP server (which is normally the one running on localhost). If you do not have a SMTP server installed in your localhost. follow those steps:

The mailutils package offers SMTP server. {% code {"lang" : "bash"} %}

 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
 ...

Now, follow SMTP server settings

SMTP server

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 provide User Name and Password
  • 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).

Now, test email notification again.