## mail_basic_test.tg
# Ask the mail service to send a message for you.
# This script logs into MAPI using the profile
# This scrip assumes:
# 1. EMAIL_PROFILE has been set. Usually set in Config.tg
# 2. A MAPI email client installed (e.g. Outlook)
# 3. This script is running in an accout that has a MAPI profile.
# (NOT running in the LocalSystem account. See the documentation on running Proxy
# services at http://www.tomasello.com/software/wincron/system_service.htm)

# send an email
{
-name mail_basic_test
-start
-stop
-action -onerror operation_fail
-action -print logon to email. This may take a moment...
-action -mail Logon myHandle "%EMAIL_PROFILE%"
-action -print sending an email
-action -mail SendMail test@wincron.com "the subject" "the body"
-action -print logoff from email
-action -mail Logoff myHandle
-action -print done!
}

# operation failed
{
-name operation_fail
-action -print mail failed with error:
-action -print %TG.LAST_ERROR%
-action -return abort
}
_________________________
Regards,
Luke Tomasello