Send Email Action Icon

Send Email

Declaration

<AMSENDEMAIL FROM="text" TO="text" SUBJECT="text" BODYFILE="text" HTML="yes/no" PROTOCOLTYPE="text (options)" AUTODISCOVERURL="yes/no" ALLOWREDIRECTION="yes/no" IGNOREINVALIDCERTIFICATE="yes/no" DOMAINNAME="text" USERNAME="text" PASSWORD="text (encrypted)" />

See Also

Get Email | Exchange | Send IM | Twitter | HTTP Download | HTTP Post | Open Web Page | MSMQ

Description

Sends an e-mail message with or without attachments to the specified recipient via SMTP, Exchange 2003 (WebDav), Exchange 2007 (EWS) or Exchange 2010 (EWS) protocol. This action supports Explicit and Implicit Transport Layer Security (TLS) and Secure Sockets Layer (SSL) security. It also supports the sending of plain text or HTML formatted e-mail, the use of file contents as the e-mail body, requesting of delivery reports and read receipts (if the recipient's e-mail program supports delivery reports and/or read receipts).

Practical Usage

Used to send an e-mail message plain text or HTML formatted, with or without attachments, using SMTP or Exchange Server Protocol. System administrators frequently use this action to perform system notifications or conveniently package data retrieved from any other source such as databases or web sites.

Parameters

Email Properties

Property

Type

Req'd

Default

Markup

Description

From

Text

Yes

(Empty)

  1. FROM="me@mycompany.com"

  2. FROM="My Company Webmaster <webmaster@netauto.com>" (Exchange protocol only)

The e-mail address information about who the mail should be sent from. Available formats are illustrated under Markup.

NOTE: This parameter is empty by default but usually required by most servers.

To

Text

Yes

(Empty)

  1. TO="you@netauto.com"

  2. TO="bob@netauto.com;amy@netauto.com"

  3. TO="Network Automation Webmaster <webmaster@netauto.com>" (Exchange protocol only)

The recipient(s) in which to send the message to. Multiple recipients can be specified by separating each entry with a semi-colon (;). Available formats are illustrated under Markup.

Subject

Text

No

(Empty)

SUBJECT="Weekly Report"

The subject of the message.

Body

Text

No

(Empty)

>This is the body</AMSENDEMAIL>

The body of the message. If the Is HTML parameter is set to YES, this section should be properly formatted HTML, otherwise this parameter should contain a plain text version of the message.

Is HTML

Yes/No

No

No

HTML="YES"

If set to YES, specifies that the body of the message is formatted HTML and should be displayed by the recipient's mail client as such (if supported). Also causes the following mail header data to be inserted: Content-Type: multipart; boundary="xxxxx". If set to NO (default), the message is formatted in plain text.

Use file contents as body

Text

No

Disabled

BODYFILE="c:\foldername\body.txt"

If enabled, indicates that the body of the message should be obtained from the specified text file. You may enter the path and file name of the desired file manually or click the folder button to navigate to the desired file. This parameter is disabled by default.

NOTE: This parameter only accepts contents of a single file. It does not support multiple file contents.

Server Properties

These properties provide the option to enter custom mail server settings or attempt to use the default mail server settings as specified in the system properties. Different parameters become available depending on the option selected. Note that this parameter only supports SMTP mail servers. The available options are:

Property

Type

Req'd

Default

Markup

Description

Protocol

Text (options)

Yes

SMTP

PROTOCOLTYPE="SMTP"

The protocol type to use. This parameter is available only if the Custom server settings parameter is enabled. Different parameters become available depending on which option is chosen. The available options are:

  • SMTP (Default)

  • Exchange 2003 (WebDav)

  • Exchange 2007 (EWS)

  • Exchange 2010 (EWS)

If the Protocol selected is SMTP, the following parameters become available. Note that a  set of parameters exclusive to Exchange protocols are available as well.

Server

Text

Yes

(Empty)

SERVER="mail.server.com"

The SMTP server that should be used to send the message. This parameter is available only if the Protocol parameter is set to SMTP.

Port

Number

No

25

PORT="3333"

The port that should be used when connecting to the SMTP server. Most SMTP servers run on port 25 (default port number) however, this parameter can be customized to connect to another port. This parameter is available only if the Protocol parameter is set to SMTP.

Security

Text (options)

Yes

No security

SECURITY="EXPLICIT"

The type of security that this action should use. This parameter is available only if the Protocol parameter is set to SMTP. The available options are:

  • No Security (default) - Specifies that no security will be administered.

  • Explicit TLS/SSL - Indicates that Explicit Transport Layer (TLS) and Secure Sockets Layer (SSL) security will be administered.

  • Implicit TLS/SSL - Indicates that Implicit Transport Layer (TLS) and Secure Sockets Layer (SSL) security will be administered.

Disable chunking and pipelining

Yes/No

No

No

DISABLECHUNKING="YES"

 

If set to YES, chunking and pipelining will be disabled (set to NO by default). This parameter is available only if the Protocol Type parameter is set to SMTP.

Chunking refers to the ability to allow inconveniently large messages to be broken into conveniently-sized smaller "chunks."Pipelining reduces the time it takes to send multiple messages. A sending server would use pipelining to send all the messages it has to a receiver in one go. It simply sends all the commands "down the pipe" without waiting for a response from the remote server. Once all the commands have been received, only then will the remote server issue all its responses at once. Chunking and pipelining can possibly speed up transmissions.

NOTE: Some anti-virus programs may cause e-mail transmission issues when chunking and pipelining is enabled.

Use authentication

 

Yes/No

 

No

No

AUTHENTICATION="YES"

If set to YES, indicates that a username/password is used to authenticate with the server. Other parameters become available if this parameter is set to YES. Set to NO by default.

Domain name

Text

Yes if Use Authentication is set to YES.

(Empty)

DOMAINNAME="my.domain.com"

The domain name to authenticate with. This parameter is available only if the Use Authentication parameter is selected.

Username

Text

Yes if Use Authentication is set to YES.

(Empty)

USERNAME="me"

The user name to use to logon to the mail server and authenticate the mail transaction. This parameter is available only if the Use Authentication parameter is selected.

NOTE: The From address entered should belong to the authenticated user.

Password

Text

Yes if Use Authentication is set to YES.

(Empty)

CERTIFICATEPASSPHRASE=

"encrypted"

The password used to logon to the mail server and authenticate the mail transaction. This parameter is available only if the Use Authentication parameter is selected.

Certificate

Text

Yes if Use Authentication is set to YES.

No

CERTIFICATE=

"c:\folder\certname.pfx"

The full path and filename of the certificate (.cer or .pfx extension) used to authenticate with. This parameter is available only if the Security parameter is set to Explicit TLS/SSL or Implicit TLS/SSL.

If the Protocol selected is  Exchange 2003 (WebDav), Exchange 2007 (EWS) or Exchange 2010 (EWS), the following parameters are available:

Exchange Server

Text

Yes

(Empty)

SERVER=

"https://www.server.com"

The Exchange server that should be used to send the message. This parameter is available only if the Protocol Type parameter is set to Exchange 2003 (WebDav), Exchange 2007 (EWS) or Exchange 2010 (EWS).

Autodiscover service URL

Yes/No

No

No

AUTODISCOVERURL="yes"

The Autodiscover service configures and maintains server settings for client computers that are running Microsoft Office Outlook 2007 and supported mobile devices. It provides access to Microsoft Exchange features for Outlook 2007 clients that are connected to your Microsoft Exchange messaging environment. If this parameter is set to YES, specifies that Autodiscover service requests will be performed. This parameter is set to NO by default and is only available if the Protocol Type parameter is set to Exchange 2007 (EWS) or Exchange 2010 (EWS).

Allow redirection

 

Yes/No

No

No

AUTODISCOVERURL="yes"

If set to YES, redirection (or mail forwarding) to another server will be allowed. This parameter is set to NO by default and is only available if the Protocol Type parameter is set to Exchange 2007 (EWS) or Exchange 2010 (EWS).

Ignore invalid server certificates

Yes/No

No

No

IGNOREINVALIDCERTIFICATE="yes"

If set to YES, invalid or expired SSL server certificates that are detected will be ignored. If set to NO and an invalid server certificate is found, this step will throw an error stating that the security certificate on the server is not valid. This parameter is set to NO by default and is only available if the Protocol Type parameter is set to Exchange 2007 (EWS) or Exchange 2010 (EWS).

Use Authentication

If enabled, authentication will take place during the transmission. The following parameters become available. Note that this is a design time parameter and therefore contains no markups. It is disabled by default.

Authentication Type

Text (options)

No

(Empty)

AUTHTYPE="form"

Specifies the authentication type to administer. The following options are:

  • Basic

  • Default

  • Form (WebDav only)

Username

Text

Yes if Use Authentication is set to YES.

(Empty)

USERNAME="theUser"

A valid user name used to logon to the mail server and authenticate the mail transaction. This parameter is available only if the Use Authentication parameter is set to YES.

NOTE: The From address entered should belong to the authenticated user.

Password

Text

Yes if Use Authentication is set to YES.

(Empty)

PASSWORD="encryptedtext"

A valid password used to logon to the mail server and authenticate the mail transaction. This parameter is available only if the Use Authentication parameter is set to YES.

NOTE: The From address entered should belong to the authenticated user.

Attachments Properties

Property

Type

Required

Default

Markup

Description

Attach

Text

Yes

(Empty)

  1. ATTACH="c:\folder\file.zip

  2. ATTACH="c:\file1.zip;c:\file2.zip"

Specifies file(s) to attach to the e-mail message. Files will be MIME encoded automatically. In Markup mode, multiple file attachments must be separated by semi-colons (;), in visual mode simply add the files to the list by clicking the Folder icon to select the appropriate file to attach then click Add to add the attachment selected. Added attachments will be shown under Current Attachments. To edit or remove an attachment from the Current Attachments list, select the attachment and click Edit or Remove.

Advanced Properties

Property

Type

Req'd

Default

Markup

Description

CC

Text

No

(Empty)

CC="admin@mycompany.com"

The addresses that the message should be sent "carbon-copies" to. Multiple recipients must be separated by semi-colons (;). This parameter will accept the following formats:

  1. webmaster@mycompany.com

  2. My Company Webmaster <webmaster@mycompany.com>

  3. webmaster@mycompany.com;sales@mycompany.com

Reply to

Text

No

(Empty)

REPLYTO="me@mycompany.com

The address information about who the mail should be from.

BCC

Text

No

(Empty)

 

BCC="sales@mycompany.com"

The addresses that the message should be sent "blind-carbon-copies" to. Use of the "blind-carbon-copies" hides the addresses from the target users. Multiple recipients must be separated by semi-colons (;). This parameter will accept the following formats:

  1. webmaster@mycompany.com

  2. My Company Webmaster <webmaster@mycompany.com>

  3. webmaster@mycompany.com;sales@mycompany.com

XMailer

Text

No

AutoMate

XMAILER="AM8"

The X-Mailer header identifies the software that created the e-mail message. By default, this parameter is set to AutoMate.

Priority

Text (options)

No

Normal

PRIORITY="high"

The level of importance that the message being sent should be marked as. The recipient's e-mail client might in some way indicate the importance you assigned to a message. For example, messages carrying highest importance may be bolded in the Inbox or marked red, while less important messages can be grayed out or moved down the list. The available options are:

  • Low - The message is set to low importance.

  • Normal (Default) - No importance level is assigned, therefore, no alerts will be seen by the recipient.

  • High - The message is set to high importance.

Sensitivity

Text (options)

No

Normal

SENSITIVITY="personal"

The level of sensitivity that the message being sent should be marked as. For each of the sensitivity settings, the recipient will see specific text in the InfoBar of the message. The available options are:

  • Normal (Default) - No sensitivity level is assigned to the message, so no text is displayed in the InfoBar.

  • Personal - The recipient will see Please treat this as Personal in the InfoBar.

  • Private - The recipient will see Please treat this as Private in the InfoBar.

  • Confidential - The recipient will see Please treat this as Confidential in the InfoBar.

NOTE: Each of these sensitivity settings is only an advisory. Recipients can take any action on the message that they want to, such as forwarding a confidential message to another person.

Request delivery report

Yes/No

No

No

REQUESTDELIVERYREPORT="YES"

If set to YES, specifies that a delivery receipt will be received upon delivery of the e-mail message to the recipient's mailbox. This option is set to NO by default.

NOTE: A delivery receipt may not be received if the recipient's e-mail program does not support delivery receipts.

Read receipt

Yes/No

No

No

READRECEIPT="YES"

If set to YES, specifies that a read receipt will be received when the e-mail message has been opened. This option is set to NO by default.

NOTE: In Microsoft Office Outlook, the message recipient has the option to decline to send read receipts. Additionally, read receipts are not sent if the recipient's e-mail program does not support read receipts.

Custom Headers

Text

No

(Empty)

CUSTOMHEADERS="Description;Daily Report"

Specifies one or more custom headers to send, which can be a useful way to exchange information using a standardized approach. To specify a custom header, click the Click here to add new item link and enter the desired header name and value in the Name and Value field.

Proxy Properties

Property

Type

Req'd

Default

Markup

Description

Proxy Type

Text (options)

No

(Empty)

PROXYTYPE="Socks5"

Specifies proxy protocol that should be used. If you are unsure of the value to use in this parameter, contact your network administrator. The available options are:

  • System Default (default, recommended):  The settings specified in the Task Administrator preferences are used.

  • None:  Explicitly instructs the action not to use a proxy server regardless of the system default

  • Socks 4:  Instructs the action to go through a Socks 4 compliant server

  • Socks 4a:  Instructs the action to go through a Socks 4a compliant server

  • Socks 5:  Instructs the action to go through a Socks 5 compliant server

Note:  To create the most portable tasks it is best to specify "system default" and specify proxy settings in the Preferences of the Task Administrator (Proxy Tab).  By proceeding this way, tasks created in one environment that may have a proxy server will be portable to others that do not - and vice-versa.

Proxy Port

Number

No

1028

PROXYPORT="3000"

The port that should be used to connect to the proxy server. Most proxy servers operate on port 1028 (the default) however the proxy server can be customized to operate on other ports

Proxy Host

Text

No

(Empty)

ROXYSERVER="proxy.host.com"

 The host name (server.domain.com) or IP address (xxx.xxx.xxx.xxx) of the proxy server.

Username (Proxy)

Text

No

(Empty)

PROXYUSERNAME="username"

The username that should be used to authenticate when connecting through the proxy server. This option is only valid when Socks 5 is specified in the Proxy type as it is the only version that supports authentication.

Password (Proxy)

Text

No

No

PROXYPASSWORD="encrypted"

The password that should be used to authenticate when connecting through the proxy server. When the step is created using the Task Builder it is written to the task encrypted. This option is only valid when Socks 5 is specified in the Proxy type as it is the only version that supports authentication.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: Send e-mail message "report" to "you@yourcompany.com"

<AMSENDEMAIL FROM="me@mycompany.com" TO="you@yourcompany.com" SUBJECT="report" ATTACH="C:\Temp\Folder10\report.txt" PROTOCOLTYPE="ews2007" AUTODISCOVERURL="yes" ALLOWREDIRECTION="yes" IGNOREINVALIDCERTIFICATE="yes" DOMAINNAME="my.domain.com" USERNAME="me" PASSWORD="AM2SEnddJUXr7JfScp05hfctg==aME">This is the body of the email.</AMSENDEMAIL>

 

↑ Top of Page