1.插件的安装Email Extension Plugin#
Email Extension
插件介绍:
https://wiki.jenkins.io/display/JENKINS/Email-ext+plugin#Email-extplugin-TemplateExamples
在插件管理中安装插件Email Extension
2.插件的配置#
需要准备一个邮件的账号用户发送邮件的账户,开通stmp服务
配置–>系统设置
默认的邮件配置:
邮件通知
SMTP服务器 smtp.163.net
用户默认邮件后缀 @163.com
使用SMTP认证 [✔]
用户名 xxx@163.com
密码 •••••••••••••••••
SMTP端口 25
字符集 UTF-8
通过发送测试邮件测试配置 [✔]
配置邮箱来测试邮件功能是否正常
配置邮件插件:
配置–>系统设置
Extended E-mail Notification
SMTP server smtp.163.net
Default user E-mail suffix @163.com
Default Content Type Plain Text(text/plain)
高级配置:
Use SMTP Authentication [✔]
User Name xxxx@163.com
Password *
SMTP port 25
Charset UTF-8
选中:
Enable Debug Mode
Allow sending to unregistered users
不然再构建中报错:
3.jenkinsfile 模版#
1 | pipeline { |
接收邮件: