Can Jenkins send mail notify with attachment?
Asked Answered
C

3

7

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) ?

Chemar answered 5/8, 2011 at 6:50 Comment(0)
H
10

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:

Hinton answered 19/12, 2011 at 6:4 Comment(1)
the jenkins wiki always loads so slow.Blastoderm
T
1

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

Tripoli answered 15/7, 2021 at 16:31 Comment(0)
L
0

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

Lil answered 11/8, 2011 at 19:54 Comment(1)
right, i used extended notify mail plugin to send mail in html format. Before that i used autohotkey and powershell to save sheet into html format. Then i joined sheet in html and my text. That big string i used to send something by email.Chemar

© 2022 - 2024 — McMap. All rights reserved.