12

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: abc@example.com
Error sending to the following VALID addresses: abc@example.com

Note: There are no build logs attached while sending email.

James Z
  • 12,209
  • 10
  • 24
  • 44
user7577187
  • 121
  • 1
  • 1
  • 4
  • Possible duplicate of [Jenkins ext-email plugin fails to send email on build success](http://stackoverflow.com/questions/16191040/jenkins-ext-email-plugin-fails-to-send-email-on-build-success) – Jon S Feb 16 '17 at 20:32
  • I have tried all the options mentioned in the link. But with the same configuration when manually triggered through Build Now option I receive email. When I scheduled it for some time, I am not able to receive it. – user7577187 Feb 17 '17 at 01:08

5 Answers5

18

You should set SMTP Server and Authentication in both E-mail Notification and Extended E-mail Notification sections. Click Advanced button to see this Use SMTP Authentication section.

Kernel
  • 661
  • 7
  • 10
  • 1
    "You should set SMTP Server and Authentication in both E-mail Notification and Extended E-mail Notification sections. Click Advanced button to see this Use SMTP Authentication section." I have done this and tested connections it's working but not working when build is sucess – Ashish Karpe Oct 26 '17 at 10:06
  • 4
    Make sure your Job's E-mail Notification triggers is Always.@AshishKarpe – Kernel Nov 15 '17 at 09:35
5

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>'
i_am_beginner
  • 119
  • 3
  • 11
3

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.

Ajay
  • 31
  • 1
2

For me, file size was 5-7MB, I looked at my internet speed meters, saw it, using the full upload speed for around 1 minute, but couldn't complete and gave that error message.

Then I tried smaller file, like 10KB, it worked like charm.

So, for my case, my guess is, somehow file is not getting properly uploaded to email server.

touhid udoy
  • 4,005
  • 2
  • 18
  • 31
0

If every thing fails, try restarting jenkins process. That solved for me. Somehow the Jenkins system was unable to load all of the configs? But give it a try.

Maniankara
  • 452
  • 2
  • 8