deadfish
deadfish

Reputation: 12304

Can Jenkins send mail notify with attachment?

can Jenkins send mail notify to recipients with attachments? What is more important for me (optional), it could also read from file *.xls and add this to email text.

Or can i add from my system variable to data, which is sending by plugin of jenkins (ext mail) ?

Upvotes: 7

Views: 45951

Answers (3)

Vladi
Vladi

Reputation: 2000

how I make a Jenkins send me an Email always with attached HTML file when the Jenkins trigger

1) press "Configuration"

enter image description here

2) in the top part of configuration press "Post-build Actions"

enter image description here

3) press on "add post build action " and choose "editable email notification"

enter image description here

4) after it been added enter "Project Recipient List" a emails you want to send (possible to add more than one mail , like in the example)

enter image description here

5) scroll down, add to the "Attachments" direction to the file you want to send

6) in the end of the page press on button "advanced settings" from the right side

![enter image description here

  1. **add trigger to the sending email by the option you prefer **

enter image description here

Upvotes: 1

Steve HHH
Steve HHH

Reputation: 13147

New answer, as of September 2011: Yes. Issue 9018 has been resolved.

Starting with version 2.15 of the Jenkins email-ext plugin, you can send attachments in Jenkins build notifications. See the Jenkins wiki here:

Upvotes: 10

Zach Young
Zach Young

Reputation: 11223

This issue was recently posted on the Jenkins JIRA: Issue 9018. That site is not responding for me right now, so I can't even see what the status is.

Regarding the e-mails in the XLS file, I did a search of the Jenkins plug-ins and could not find anything for "XLS" or "Excel". If you're Jenkins instance is running on Windows, you could use VBScript and COM to either export the list to a parsable format like TAB or CVS; or you could try to programmatically look through the list for the e-mails and get the VBScript to return them as one big string. This forum has a pretty clear example of opening a workbook, selecting the appropriate worksheet, and then iterating through the cells: XLS & VBScript. Oh, and I just remembered that if you have newer versions of Visual Studio and Office, there's interoperability there that might be easier; though I've never tried that combo.

I hope this helps,
Zachary

Upvotes: 0

Related Questions