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