简体   繁体   中英

How to set from address in Jenkins with email-ext plugin?

Using AWS SES as mail server. Set smtp, username and password at Extended E-mail Notification area. But didn't find where to set from address. If don't set it, the send mail will be failure:

SendFailedException message: 501 Invalid MAIL FROM address provided

At Jenkins Location area, there is a System Admin e-mail address input. Even set an address there, can't send mail successfully.

在此处输入图片说明

We use Jenkins pipeline and we set the from via the emailext option:

def subject = "JENKINS-NOTIFICATION: ${buildStatus}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'" 

emailext(
            mimeType: 'text/html',
            replyTo: '$DEFAULT_REPLYTO',
            subject: subject,
            from: 'jenkins@host.com',
            to: 'dummy@corp.com',
            body: '${SCRIPT,template="email.template"}',
            attachLog: true,
            compressLog: true,
            recipientProviders: [[$class: 'DevelopersRecipientProvider']]
    )

See also the documentation on which options you can define.

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