I will receive emails when I trigger using build now manually, but I don't receive emails when I tried to using it in batch mode. Below is the log I obtain when triggered in batch mode.
Email was triggered for: Always Sending email for trigger: Always Sending email to: [email protected] Error sending to the following VALID addresses: [email protected]
Note: There are no build logs attached while sending email.
In your Jenkins configuration, make sure that you have entered correct email address for "System Admin e-mail address".
Notification e-mails from Jenkins will be sent with this address in the "from" header.
Error - Not sent to the following valid addresses: <valid_recipient_address> OR Error sending to the following VALID addresses: <valid_recipient_address>
Reason - Email address of sender is not correct.
How to troubleshoot - Enable the debug mode from Jenkins -> Manage Jenkins -> Configure System -> (Search for Extended E-mail Notification configuration -> Check Enable Debug Mode
Example of Working code
emailext attachLog: false,
attachmentsPattern: 'example_file.yaml',
from: '<valid_sender_address>',
body: 'Test Message',
subject: 'Test Subject',
to: '<valid_recipient_address>'
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