0

I want to send an email using Python smtplib when Windows Update notification is triggered.

Anyone have an idea how to accomplish this?

I searched on here and Google but didn't find anything.

This is the Python code I have to send the email:

import smtplib, getpass

pswd = getpass.getpass('Password:')

smtpObj = smtplib.SMTP('smtp.gmail.com', 587)
smtpObj.ehlo()
smtpObj.starttls()
smtpObj.login('...@gmail.com', pswd)
smtpObj.sendmail('...@gmail.com', '...@gmail.com', 'Subject: Windows Update.\nThere is an update available.')
{}
smtpObj.quit()
Mat S
  • 1
  • 2
  • Could you provide more details? For example, is the Windows Update notification running on the server? What is the context of your code? – Michael Palermo Nov 13 '15 at 18:51
  • Yes, sorry. This will be for a Windows Update notification running on the Windows Server 2012. I have the code set to send the email using smtplib in Python, I just don't know how to link this up to be triggered when there is a Windows Update notification. – Mat S Nov 13 '15 at 19:07
  • Any suggestions anyone? – Mat S Nov 16 '15 at 21:00

0 Answers0