ScriptPro Editor This topic is for use by scriptwriters who are using ScriptPro Editor to create custom scripts for their agencies. Agents can go to Using ScriptPro Scripts for more information about using custom or standard scripts within Travelport Smartpoint. |
Mail Commands
Mail functions enable sending, reading, locating, saving and deleting Microsoft Mail messages.
MAILADDRESS
Function |
Displays the MS Mail Address dialog with the list of recipients and prompts for additional recipients. |
Syntax |
MAILADDRESS (string_variable, number_variable)
|
Example |
MAILADDRESS (corp_contact, RET_CODE) See Additional Mail Command Examples for more examples. |
MAILDATE
Function |
Returns the date the message was originally received. |
Syntax |
MAILDATE (string_variable, date_variable, number_variable)
|
Example |
MAILDATE (message_iden, msg_date, RET_CODE) The function locates the message based on the MsgID located in message_iden. The date is returned in msg_date and RET_CODE contains the return code. See Additional Mail Command Examples for more examples. |
MAILDELETE
Function |
Deletes the message identified by MsgID. |
Syntax |
MAILDELETE (string_variable, number_variable)
|
Example |
MAILDELETE (message_iden, RET_CODE) The function deletes the mail message matching the MsgID contained in message_iden. RET_CODE contains the return code. See Additional Mail Command Examples for more examples. |
MAILFIND
Function |
Retrieves a message based on a keyword. The keyword is not case sensitive. If Keyword and MsgID are blank (e.g., ""), the first message is returned based on the ReadFlag parameter. If the Keyword is blank (e.g., "") and MsgID has a value, the first message following the MsgID is returned. The MsgID is a unique identifier for a mail message. Note: This function can be time consuming when searching through all mail. Limit the search by searching new files only or by setting the flag to search based on the from or subject field. |
Syntax |
|
Example |
MAILFIND ("Coke", MM_SUBJECT, MM_NEW, msg_id, read_ind, RET_CODE) This function searches for the keyword "Coke" in the subject field of all unread mail starting with the first unread message. Read_ind and RET_CODE contains the return codes. See Additional Mail Command Examples for more examples. |
MAILLOGOFF
Function |
Logs off of MS Mail. This can be used in a script to close the mail session before terminating. Otherwise, logging off is handled at the completion of the script. |
Syntax |
MAILLOGOFF |
Example |
MAILLOGOFF The function logs out of MS Mail. |
MAILLOGON
Function |
Logs on MS Mail with the specified User Name and password. Both parameters are case sensitive. |
Syntax |
MAILLOGON (string_type1, string_type2)
|
Example |
MAILLOGON (logon_name, "password") The function logs into MS Mail with logon_name and "password." |
MAILREAD
Function |
Reads a message into the appropriate strings. If the text, recipients or attachments list is too long (i.e., greater than 255 characters), the string contains the name of a temporary file which contains the information (e.g. @temp.fil). If there is no mail in the Inbox or a MsgID match is not found, the RET_CODE is set to 0. |
Syntax |
MAILREAD (string_variable1, string_variable2, string_variable3, string_variable4, string_variable5, string_variable6, number_variable)
|
Example |
MAILREAD (msg_iden, sender, recip, subject, mail_text, attach, RET_CODE) The function reads in the first unread mail message when "msg_iden" is empty. The sender, subject, text and attachment information are stored in the fields designated in the function call. RET_CODE contains the return code. See Additional Mail Command Examples for more examples. |
MAILSAVE
Function |
Saves information to the message identified by the MsgID. |
Syntax |
MAILSAVE (string_variable1, string_type2, string_type3, string_type4, string_type5, number_variable)
|
Example |
MAILSAVE (message_iden, "@recip.lst", dallas_subject, trip_text, "", RET_CODE) The function saves the information indicated in the to, subject, text and attachment fields to the mail message identified in message_iden. RET_CODE contains the return code. |
MAILSEND
Function |
Sends a mail message with optional attachments. |
Syntax |
MAILSEND (string_type1, string_type2, string_type3, string_type4, dialog_style, number_variable)
Note: Using "@filename" enables storing information in a file such as a list of recipients or filenames. The file must delimit each field with a semicolon or a carriage return and line feed. |
Example |
MAILSEND ("Lori Tracy", cruise_subject, "In May, we are offering a 7 day, 6 night cruise to Mexico for only $795. Please read the attachment for additional information.", cruise.may, TRUE, RET_CODE) The function above sends a mail to "Lori Tracy" with the subject contained in cruise_subject, the text "In May,...", the attachment file "cruise.may", the Send Note dialog always displays and RET_CODE contains the return code.
MAILSEND ("@coke.emp", avis_special, avis_special_text," c:\car\avis.txt", TRUE, RET_CODE) The function above sends a mail to the recipients listed in the "coke.emp" file with the subject contained in "avis_special", the text contained in "avis_special_text", the attachment file "c:\car\avis.txt", the Send Note dialog always displays and RET_CODE contains the return code. See Additional Mail Command Examples for more examples. |
MAILWAIT
Function |
Causes the script to pause until new mail arrives or unread mail is found. |
Syntax |
MAILWAIT (string_variable) string_variable returns the MsgID of the first unread message or new message. |
Example |
MAILWAIT (message_iden) The function waits until a new mail is received and returns the MsgID in message_iden. See Additional Mail Command Examples for more examples. |