How to send email notification with Jenkins? -
i want send email when build failed. i've configured system admin e-mail address : test@gmail.com , smtp server : smtp.gmail.com.
here's code in pipeline :
pipeline{ agent none stages{ stage('test'){ agent{ label 'vstest' } steps{ script{ //nothing } } } } post{ always{ mail to: 'test@gmail.com', subject: "failed pipeline: ${currentbuild.fulldisplayname}", body: "something wrong ${env.build_url}" echo "sent" } } } i'm getting error :
com.sun.mail.smtp.smtpsendfailedexception: 530 5.7.0 must issue starttls command first.
someone knows why? thx.
you using default smtp port (25) not work gmail account. try using port 465 ssl or port 587 tls.
this guide might help: http://www.360logica.com/blog/email-notification-in-jenkins/
Comments
Post a Comment