SEND_MAIL(Receiver, [Cc], Subject, Text, [Attachment],[Agent, Login Object] | [_SERVER, _DEFAULT])
Syntax |
Description/Format |
---|---|
Receiver |
The person that should receive the message. |
Cc |
The person that should receive a copy of this message. |
Subject |
Short description of the message. |
Text |
Message text. |
Attachment |
The path and the name of the files that should be sent as an attachment. Separate the individual paths with a comma (,) if you want to send several files. |
Agent |
Specifies the agentA program that enables the de-centralized execution of processes (such as deployments) on target systems (computers or business solutions) or a service that provides connectivity to a target system (such as for databases or middleware). An agent is also an object type in the Automation Engine. [Formerly called "Executor."] See also: host that should be used to send the email message(s). (optional) Value:
If you don't specify an agent, the email is sent by the AE/server The value "*SERVER" can be used to force sending the email via the AE/server (even if you set a central Agent/loginAn Automation Engine object type that stores account credentials used by agents on target systems.). For the value "*DEFAULT", the UC_CLIENT_SETTINGS values are used. The specified agent and the Automation EngineThis component drives an Automation Engine system and consists of different types of server processes. system must have the same version. |
Login |
This optional parameter specifies the Login object that is used to send the email message(s). (optional) Value:
This parameter is ignored, if the parameter Agent is set to "*SERVER" (no Login object needed). It is mandatory, if you specified the Agent parameter. |
Return codes |
---|
"0" - Email
was sent successfully. |
The sending of emails depends on the user's PC configurations.
This script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… does not check whether the specified Receiver actually exists. The message is sent even if the receiver is not correct.
When the email cannot be sent because the attachment cannot be found or the email connection is not active, script processing continues by default. In this case, the script function returns the corresponding return codeThe value that represents the result of tasks and script functions..
You can use the script statement :ON_ERROR to cancel script processing if an error occurs. To analyze the error, you use the script functions for error handling.
This script element always sends emails via the Automation Engine. Files that should be attached must be stored on the computer of the AutomationEngine or be accessible from there (UNC path).
Tthe number of characters is limited to 1024 characters per line.
The script function causes all open transactions of the script to be written to the AE databaseA database is an organized collection of data including relevant data structures..
To send emails, you must have configured the E-mail connection.
The parameters Agent and Login may also be defined client-wide in the UC_CLIENT_SETTINGS variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type., using the key SEND_MAIL_DEFAULT. Settings in individual SEND_MAIL script functions will be overridden by the key in UC_CLIENT_SETTINGS anywhere throughout the respective client.
In the following example, an email is sent only to one user (no copies). One file is attached to this email.
:SET &OUT# = SEND_MAIL('brown@automic.at',,'Meeting','Meeting today at 5pm', '/AE/agenda')
An email that includes two attachments is sent to several persons:
:SET &OUT# = SEND_MAIL("brown@automic.at;smith@automic.us",,"Meeting","Meeting canceled","c:\AUTOMIC\agenda.doc;c:\AUTOMIC\dates.txt")
See also:
Script element | Description |
---|---|
This statement is used to send messages to the user who is logged on to the UserInterfaceThis is the Automation Engine's graphical user interface. [Formerly called the "Rich Client", "RichGUI" and "Dialog Client."]. | |
:ON_ERROR | Determines the reaction to certain errors and messages of script elements. |
Script Elements - Error Handling and Messages
Sample Collection:
Retrieving Error Message and Number
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |