Skip to main content
Skip table of contents

MailTrigger

Purpose

This function returns the index in the MAPI message list of the message that caused the last trigger.  If you created an event that triggers when an E-mail is received, then you can run a script as the action to the event.  In the script, you call this function to get the index for the message that caused the trigger.  You can now examine the message to take more action.


Parameters

None


Returns

Return value: index
Type: long
Description: This is the index of the E-mail message that was last received.


Example

Sample Code

VB
' this script will access the E-mail message that caused this event to trigger
' it will then speak the subject line of the message
sub main()

	dim index
	dim subject
	index = hs.MailTrigger
	subject = hs.MailSubject(index)
	hs.speak "You have mail! The subject is "
	hs.speak subject     

end sub


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.