Reputation: 371
I set up the JENKINS Editable Email notification for my project with trigger for all builds.
the build runs successfully but the emails does not send. The follwing is the result in the console output.
BUILD SUCCESSFUL
Total time: 43 seconds
Email was triggered for: Always
Sending email for trigger: Always
Sending email to: chauhanheena@gmail.com
Connection error sending email, retrying once more in 10 seconds...
Connection error sending email, retrying once more in 10 seconds...
Failed after second try sending email
Finished: SUCCESS
Upvotes: 37
Views: 64917
Reputation: 1306
Since I don't know the error log of your issue, I will try to give what worked for me. I tried everything else but the below step saved me. Hope it will help someone with the similar issue.
I just set the System Admin e-mail address correctly.
here are detailed steps:
Try this out and test again to send:
your-name <email-id@somedomain.com>
Upvotes: 2
Reputation: 332
A little late to the party but here's how I made it work in my case. I was trying to authenticate the credentials with AWS SES
.
TLDR: Try a different SMTP Port. Changing the port from
587
to465
allowed Jenkins to authenticate with AWS SES.
And for those who are curious. Here's how I figured out what the issue was.
Go to following location.
Jenkins > Manage Jenkins > Configure System
Scroll down until you find the following option to Enable Debug Mode
. See below.
And after enabling the debug mode, the console output became a lot more detailed and I could see the below at the very end.
Changing the SMTP Port allowed Jenkins to go through. SES allows the following ports.
Port: 25, 465 or 587
Hopefully that should fix the issue and allow emails to flow though. Or else the the debug mode might steer you in the right direction.
EDIT: Important
The email I was trying to send was from the Editable Email Notification
section.
Jenkins > Project
$Project_Name
> Configure > Post Build Actions > Add Post Build Action > Editable Email Notification.
Upvotes: 6
Reputation: 61
I was also facing the same issue but again i revisit below things and it worked.
First make sure email notification related plugins are installed (Manage Jenkins->Manage Plugins->Check if email related plugins are
installed or not)
Then Go to Configure System(Manage
Jenkins->Configure system) and navigate to Extended E-mail
Notification section and provide
Save above all.
Now all you need to do is to set up post build section - Open ur project and in post build section( From your Projecct click on configure), provide desire email address(to whom you want to send the email) on Recipients field of Email Notification/Editable Email Notification field Now go ahead with build now.
Upvotes: 6
Reputation: 3689
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.
If issue still persists, then just restart jenkins, it will work. Somehow the Jenkins system was unable to load all of the configs?
Upvotes: 10
Reputation: 91
Under Manage Jenkins -> Configure System: fill in the section "Extended E-mail Notification" as per your "E-mail Notification" section. That should work.
Upvotes: 0
Reputation: 2220
I was having the same issue, and the only way I could send emails was using mail:
mail(
bcc: '',
body: "<p>your body</p>",
cc: '',
charset: 'UTF-8',
from: '',
mimeType: 'text/html',
replyTo: '',
subject: "your subject",
to: "your-email@mail.com"
)
Upvotes: 3
Reputation: 2863
Make sure SMTP server is configured under "Manage Jenkins" -> "Configure System" -> "Extended E-mail Notification"
Note also that depending on your plug-in set up, you may have another place to configure SMTP server. For example under "Manage Jenkins" -> "Configure System" -> "E-mail Notification".
That is not needed for this particular plug-in but it may lead you think you have everything done, while it is not :)
Upvotes: 56
Reputation: 107
Does your Jenkins Config have an SMTP server set up correctly? Have you tested the config with a test email?
Go to "Manage Jenkins" -> "Configure System" and scroll to the bottom to make sure these are set up correctly.
If you servlet container server doesn't have an SMTP server, then you need to find whatever your Outlook is connected to, and see if you can use that. You may need to provide credentials for authentication depending on the server's setup.
Upvotes: 0