The SENDMAIL command is a notification command that generates an email message to designated personnel.
This command has the following format:
ADDRESS VOX "SENDMAIL TO(recipientlist) {MESSAGE(text) | VAR(rexxvariable)}
[SUBJECT(text)]
[SYSTEM(sysname)]
[CC(recipientlist)]
[BATCH(YES|NO)]
[MAILID(text)]
[ATTACHMENT(filename)]"
Specifies the primary recipients of the mail message.
A recipient list is a list of one or more mail recipient names. The recipient names are text strings that the notification server attempts to resolve into e-mail addresses. If more than one name is listed, the names must be separated by a semicolon (;).
Specifies the text (or body) of the mail message. The maximum length allowed is 240 characters. MESSAGE and VAR are mutually exclusive.
Line control characters can be inserted into the text for customized message viewing.
An optional method to specify the text (or body) of the mail message. The rexxvariable specified can be either a REXX variable or a stem variable. The REXX variable referenced by this VAR parameter can hold a maximum of 30,000 characters. Text from stem variables is concatenated (with one intervening blank) to form the mail text. MESSAGE and VAR are mutually exclusive. BATCH(YES) and VAR are mutually exclusive.
Line control characters can be inserted into the text assigned to the specified REXX variable for customized message viewing.
(Optional) Subject of the mail message. The maximum length is 240 characters.
Default: There is no default.
(Optional) Specifies the name of the system that is running the notification server to which you want to direct the command.
The sysname value can contain up to eight alphanumeric characters.
Default: The local system name
(Optional) List of recipient names to receive a copy of the mail message.
If more than one name is listed, the names must be separated by a semicolon (;).
(Optional) Valid values are:
Executes the command by writing the command to an internal notification server input queue where it will be processed in batch mode.
Specifies that the issuing process waits for the return code and responses before returning to the issuer.
Notes:
Default: NO
(Optional) User-supplied text to identify or track the mail message. This text is included in the last line of the identification section (generated by CA Automation Point) that is appended to the mail body. The maximum length is 40 characters.
Note: To use the MAILID option, you must enable Append Identification section to mail body on the Configure Mail dialog.
Default: There is no default.
(Optional) User-supplied file which is to be attached to the mail message. The file name specified must be fully qualified and accessible from the Notification Server which is issuing the SENDMAIL command. Only one file can be specified per mail request. The maximum length of the file name including path is 512 characters.
Default: There is no default.
Return Information:
After the SENDMAIL command executes, it sets the special REXX return code variable RC.
Usage Note:
The SENDMAIL command displays the 5345I and 5349W messages in the window with the default name of AP Notification Messages.
Examples:
msgvar = "This email is to inform you that z/OS system Y has been IPLed" file="C:\TEMP\YourData.dat" address VOX SENDMAIL TO(John Smith) CC(Jane Jones) SUBJECT(Notification from AP) VAR(msgvar) ATTACHMENT(path)
/* This is a sample program to take a screen */ /* dump from session SYSA and send an email to */ /* support mailbox with the screen output. */
/* NOTE: This message must be viewed by the */
/* recipient using a fixed pitch font. */
session_name= 'SYSA'
recipientlist='support'
ADDRESS AXC "GETSCRN SESSION("session_name") SCREEN(YES) PREFIX(LINE)"
IF rc <> 0 THEN DO
SAY 'GETSCRN failed with rc=' rc
EXIT
END
/* Add a line feed character (hex 0a) at the end of each line on the screen dump */
/* Prefix each line with a tab character (hex 09) */
line_feed= '0a'x
tab= '09'x
DO i=1 to line.0
line.i=tab||line.i||line_feed
end
ADDRESS VOX "SENDMAIL TO("recipientlist") VAR(line.) SUBJECT(Screen dump from Session "session_name")"
IF RC <> 0 THEN SAY 'SENDMAIL with screen dump failed with rc=' rc
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|