简体   繁体   中英

Error While Sending Extended email notification from Jenkins

i have configured extended email notification in Jenkins configure system, and created a new job and configured editable email notification, once the build is completed, email is not sent and getting the following in console Not sent to the following valid addresses: user@domain.com

and here is the debug log

RSET
DEBUG SMTP: EOF: [EOF]
DEBUG SMTP: MessagingException while sending, THROW: 
com.sun.mail.smtp.SMTPSendFailedException: 451 5.7.3 STARTTLS is required to send mail [PN********6.INDPRD01.PROD.OUTLOOK.COM]

    at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2374)
    at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1808)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1285)
    at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:541)
    at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:446)
    at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:354)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
    at hudson.model.Build$BuildExecution.cleanUp(Build.java:187)
    at hudson.model.Run.execute(Run.java:1954)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Not sent to the following valid addresses: user@domain.com
SMTPSendFailedException message: 451 5.7.3 STARTTLS is required to send mail [P******06.INDPRD01.PROD.OUTLOOK.COM]

QUIT
DEBUG SMTP: EOF: [EOF]

Here is the screenshot how i configured email notification in Configure System: 系统 - 电子邮件配置

Just configure this in Jenkins options file:

JENKINS_JAVA_OPTIONS : -Djava.awt.headless=true -Dmail.smtp.starttls.enable=true
JENKINS_OPTS : -Dmail.smtp.starttls.enable=true

Add this Java argument in Jenkins.xml file for Windows or in /etc/default/jenkins for Ubuntu:

-Dmail.smtp.starttls.enable=true

Alternatively, you can try to change the SMTP port from 587 to 465. Use SSL should be true in this case.

Reference:
Jenkins SMTP TLS
https://superuser.com/questions/879361/how-to-configure-jenkins-email-notifications-through-outlook

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM