I use Jenkins email-ext plugin to send emails when a build starts. When I specified only one recipient of such emails, everything worked smoothly - I got emails.
But when I specified more recipients Jenkins stopped sending emails, despite in builds' logs I can see they are being sent (I do not get them)
Isee the following message in a build's logs: "Sending email to: [email protected] [email protected]". I do not see any errors there.
Bcc, or “blind carbon copy” functions the same as “Cc”, with one difference: Bcc-ed addresses are hidden from all recipients. Both features are available in Gmail and Outlook. To send the same email separately to various users in Outlook follow the guide below. Find and add the Bcc field for your message.
You can send a mass email to more than one recipient using the BCC feature. Click the compose box, after composing your message, click on BCC and add all your recipients. This will send the emails to the recipients keeping email addresses hidden from each other.
For a project to use this plugin, you need to enable it in the project configuration page. In the Post-build Actions section, click on Add post-build action and then select Editable Email Notification. There are three main fields that you can edit when this plugin is enabled: Project Recipient List.
I was also wondering why when one email was given it worked and when multiple email addresses were given separated by commas ',' it didn't. Managed to make it work.
This is what worked for me
pipeline {
agent any
environment {
EMAIL_INFORM = '[email protected];[email protected]'
}
stages {
}
post {
success {
emailext body: 'Check console output at $BUILD_URL to view the results.',
to: "${EMAIL_INFORM}",
subject: 'Jenkins - Released $PROJECT_NAME - #$BUILD_NUMBER'
}
}
}
You should use semi colons ';' rather than commas ',' when invoking "emailext" via declarative syntax in pipeline.
Hopefully it works now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With