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 wh
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 = 'abc@gmail.com;def@gmail.com'
}
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.