Jenkins未发送电子邮件“从SMTP主机收到错误问候”

2j4z5cfb  于 2022-11-21  发布在  Jenkins
关注(0)|答案(1)|浏览(436)

我尝试从Jenkins管道发送电子邮件,但收到以下错误

Adding recipients from trigger recipient list
Successfully created MimeMessage
Sending email to: 1211732@isep.ipp.pt
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
DEBUG SMTP: need username and password for authentication
DEBUG SMTP: protocolConnect returning false, host=smtp.gmail.com, user=p-bri, password=<null>
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL false
DEBUG SMTP: EOF: [EOF]
DEBUG SMTP: got bad greeting from host "smtp.gmail.com", port: 465, response: [EOF]
MessagingException message: Got bad greeting from SMTP host: smtp.gmail.com, port: 465, response: [EOF]

我使用以下配置配置SMTP

这是我发送电子邮件的方式

stage('Send confirmation email') {
                emailext(
                        subject: "Pipeline notify - BUILD: '${env.JOB_NAME}#${env.BUILD_NUMBER}'",
                        body: """The pipeline runned successfully. The following tasks have been made:
                        - Project built
                        -Javadoc generation and publish
                        -Runned integration and mutation tests and published its respective reports
                        -Deployed the project to Tomcat, running at http://localhost:8888
                        Build can be found at: ${env.BUILD_URL}""",
                        recipientProviders: [[$class: 'DevelopersRecipientProvider']],
                        to: "1211732@isep.ipp.pt"
                )                
            }
qni6mghb

qni6mghb1#

尝试以下设置。这对我很有效。

相关问题