OverviewEMail alerts can be a very powerful tool to use when building your automation scripts. This is because alerts can be emailed at any time of the day or night to alert system administrators of system failures or other situations that need immediate attention.
Alerts can also be used to notify an administrator that a backup has finished, a system has shutdown, etc.
With the new generation of PDAs and cell phones that can be used to check e-mail, the ability to programmatically send alerts using this technology becomes even more valuable.
How it's doneTaskGhost ships with a sample script for sending email, here it is:
Sub main(args)
Dim objEmail
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "sys_monitor@my_corp.com"
objEmail.To = "support@my_corp.com"
objEmail.Subject = "server NORBERT offline"
objEmail.Textbody = "server NORBERT is not responding."
objEmail.Send
TGCtrl.Print "Mail sent."
End SubFor this script to work, the SMTP service must be installed on the computer where the script is being run.
That's really there is to it.
You can use this technique for sending automated emails and alerts.