I want to send email notification when any job gets done. Please let me know how can we propagate.
This answer is for sending mail using python script & outlook through Jenkins.
You need to have PsExec.exe for this. This runs the applications remotely.
create a freestyle project & in that run following dos shell command:
path\to\psexec.exe -u username -p password -i 1 cmd -accepteula /c python path\to\SendMail.py
Username & password is for the windows user account where outlook runs. path\to\SendMail.py is the location of the python script. SendMail.py kinda looks like this:
import win32com.client as win32
outlook=win32.Dispatch('outlook.application')
mail=outlook.CreateItem(0)
mail.To='abc@xyz.com'
mail.Subject="Test Mail"
mail.HTMLBody="Hiii, This is just a test mail."
mail.Send()
Here I'm using wind32com for executing outlook. The mail will be sent using the default account logged in outlook.
You can trigger to build this project everytime after a job completes.
Hope this is of any help to anyone :)