NOTIFY command

Sends an email notification message.

Syntax

NOTIFY USER username <PASSWORD pwd> MAILBOX pathname ADDRESS recipient <CC cc_recipient> <BCC bcc_recipient> <SUBJECT subject> MESSAGE message <ATTACHMENT pathname>

Parameters

Name Description
USER username

The email address of the sender.

PASSWORD pwd

optional

The password for the mail server.

MAILBOX pathname

The SMTP server name to use to send the email message. For example:

MAILBOX "mailserver.example.com"
ADDRESS recipient

The email address of one or more recipients. Separate multiple email addresses with a comma.

Enter a maximum of 1020 characters.

CC cc_recipient

optional

The email address of one or more carbon copy recipients. Separate multiple email addresses with a comma.

Enter a maximum of 1000 characters.

BCC bcc_recipient

optional

The email address of one or more blind carbon copy recipients. Separate multiple email addresses with a comma.
SUBJECT subject

optional

The subject line of the email message.
MESSAGE message

The body text of the email message. The message is plain text and does not support HTML.

If you want to insert a line break in your message, use two carat characters: ^^.

ATTACHMENT pathname

optional

The path and filename of one or more attachments. Must be a quoted string.

Specify multiple attachments by entering a comma separated list of files for pathname:

ATTACHMENT "result1,result2"

Examples

Sending an error report email

You are running a script, and you want to send a notification email if the script fails. Using NOTIFY, you define the email message and include two attachments:

  • the log file
  • a .fil file containing recorded errors
NOTIFY USER "support@company.com" MAILBOX "mail.company.com" ADDRESS "script_admin@example.com" SUBJECT "Error Report" MESSAGE "Failed to process script. Details attached." ATTACHMENT "Errors.fil,ACL_Demo.log"

Remarks

Recipients and attachments

You can use the NOTIFY command to send email notification messages to one or more recipients. Messages can include attached data files and Analytics projects.

The NOTIFY command can be used to notify the appropriate personnel when a script fails unexpectedly.

Protocols and ports

The command can be used with any mail server that supports SMTP (Simple Mail Transfer Protocol), which is used by Microsoft Exchange and many other mail servers. The NOTIFY command can also be used with older email applications, from Microsoft and others, that send mail locally.

NOTIFY uses port 25, so this port must be open on the mail server or the command fails. The port number used by the command is not configurable. If NOTIFY fails with an error message, contact your IT department to find out if port 25 is blocked on your network.

Error handling

If Analytics is unable to connect with the mail server, it makes five additional attempts to connect, with a 10-second pause between each attempt. If all connection attempts are unsuccessful, the NOTIFY command is canceled, with a message written to the log, but the script continues processing.

You can use the SET command to change this default behavior. You can specify a different number of connection attempts and a different amount of time between attempts, or you can turn off additional connection attempts. You can also specify that Analytics stops processing a script if the NOTIFY command is canceled. For more information, see SET command.

An invalid email recipient is not considered a failure of the NOTIFY command and does not cause a script to stop regardless of the associated setting.