Jenkins and Office365 email notification settings

TLS is not enabled.

Just add next java property for Jenkins on start:

-Dmail.smtp.starttls.enable=true

So for Ubuntu it can be configured here:

home/ubuntu# grep ^JAVA_ARGS /etc/default/jenkins
JAVA_ARGS="-Djava.awt.headless=true -Dmail.smtp.starttls.enable=true"

After review the answers here I still got the error:

Client does not have permissions to send as this sender

So what I missed is to set the System Admin e-mail address and than everything worked well - probably the email plugin using the System Admin e-mail to connect the mailbox .

Here are all the steps to configure the mail notification (also email ext):

Go to manage jenkins > configure system:

under Jenkins Location

System Admin e-mail address: [email protected]

under Extended E-mail Notification:

SMTP server: smtp.office365.com 

Default user e-mail suffix: @domain.com

User Name: [email protected]

Password: ###########

Use SSL: no

SMTP Port: 25 or 587

Charset UTF-8

edit file: "/etc/default/jenkins"

sudo vim /etc/default/jenkins

add the line:

JAVA_ARGS="-Djava.awt.headless=true -Dmail.smtp.starttls.enable=true"

restart jenkins

sudo /etc/init.d/jenkins restart

tested on ubuntu 16


I used SMTP port 25 instead of 587 and it works