How to create email notifications for Windows Events
Sometimes, you may want to know what is happening on your PC when you are not using it. Maybe you want to be informed when someone else is logging in on it, when a program gets started on it, or when other events happen that you want to know about.
While it is possible to browse the events of the system, it is not really that comfortable of an option due to the way they are presented and filtered.
An alternative to that is to configure the system to send out emails whenever something happens that you are interested in.
This guide looks at how this is done. Lets get started.
Event email notifications
You need a third-party program for the email sending part of the solution. We are using Blat, a free command line utility that can send emails using SMTP.
Note: Your antivirus or security software may block the program, or even the program’s website, by default. You need to whitelist the website or application if that is the case if you want to use it. Why it is blocked? Because it can also be used to send out unsolicited emails (spam). A check of the most recent version of the tool revealed no hits on Virustotal.
Blat does not need to be installed, just extract it to a location on your system. Now that this is out of the way, it is time to configure the Task Scheduler.
- Tap on the Windows-key, type Schedule Tasks and select the result. If you use Windows 8 you do not need to tap on the Windows-key if you are already on the Start Screen.
- This opens the Windows Task Scheduler which you can use to configure automated tasks on the system.
- Select Action > Create Task from the menu.
- Type a name for the new task, e.g. Sign-In Notifications.
- Switch from “Run only when user is logged on” to “Run whether user is logged on or not”.
- Switch to Triggers.
- Select New, this opens a new window.
- Select “On an event” under Begin the task.
- Here you can either type in an event ID or source, open the Log menu to select the event that you are interested in, for instance event 4624 or 4634 which log logon or logoff events.
- If you just want a notification on system start, change “on an event” to logon instead.
- Switch to Actions.
- Select New to open the new action window.
The configuration of the action requires some explanation, as you need to use quite a few command line parameters. First thing to do is click on browse to select the blat.exe file on your local drive.
Add the following list of arguments under “add arguments” (all in one line):
-to “email recipient” -subject “enter subject” -body “enter body text” -server “enter SMTP server” -f “enter from email” |u “username for SMTP server” -pw “password for SMTP server”
Example:
-to email@example.com -subject Notification -body Logon -server smtp.mail.yahoo.com -f myemail@yahoo.com |u myemail@yahoo.com -pw mypassword
Once you are finished and click ok, you are asked to type the account password to complete the process.
I suggest you test the setup to see if it really works.
Security advice: Since you add the username and password of the SMTP server to the task, you may want to use a dummy account that you create solely for that purpose for that.
Closing Words
Creating email notifications for Windows events is not a difficult thing to do. Once you know what you need, it is a matter of looking up the email server information that you will be using for that.
It is important to note that you need to be careful in regards to events that you select as notification triggers. If you select an event that occurs often, you may send out too many emails too fast, which may result in a temporary or permanent account ban.