Configuring Jenkins email notification with gmail

I tried to configure jenkins to send email notification with gmail as the POP provider but I could not succeed

SMTP server - pop.gmail.com
Default user e-mail suffix - @gmail.com
Sender E-mail Address - Foobar CI <your.email@gmail.com>

Use SMTP Authentication - yes
User Name - your.email
Password - p******d

Use SSL - yes
SMTP Port - 995
Reply-To Address - noreply@gmail.com
Charset - UTF-8

Test failed with : Connection refused

javax.mail.MessagingException: Could not connect to SMTP host: pop.gmail.com, port: 995; nested exception is: java.net.ConnectException: Connection refused: connect


The hostname for the Google SMTP server is smtp.gmail.com and if you use SSL, then the correct Port is 465.

A POP server is usually just for receiving mails, not sending mails.


Below are the updated gmail SMTP server configuration :

Gmail SMTP server address: smtp.gmail.com
Gmail SMTP user name: Your full Gmail address (e.g. example@gmail.com)
Gmail SMTP password: Your Gmail password
Gmail SMTP port: 465
Gmail SMTP TLS/SSL required: yes

This configuration is working fine for me .


The above configuration didn't work because of added security measures by google. An additional configuration is required in the Gmail account from which the mail is being triggered. This step authorizes apps like Jenkins to use the Gmail account.

https://support.google.com/accounts/answer/6010255

Go to the "Less secure apps" section in My Account. Next to "Access for less secure apps," select Turn on. (Note to G Suite users: This setting is hidden if your administrator has locked less secure app account access.)

After this emails were triggered successfully.

链接地址: http://www.djcxy.com/p/81374.html

上一篇: 詹金斯电子邮件配置

下一篇: 使用gmail配置Jenkins电子邮件通知