Email - Send message

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)" />

Related Topics

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

Connection

Property

Type

Required

Default

Markup

Description

Connection

---

---

---

---

Indicates where user credentials, server settings and other preferences required to establish a connection to the email server should originate from. This is a design mode parameter used only during task construction and configuration, thus, comprises no markups. The available options are:

  • System (default) - Specifies that user credentials, server settings and advanced preferences are obtained from a pre-configured properties set via the system.

  • Host - Specifies that user credentials, server settings and advanced preferences are configured individually for this activity. This option is normally chosen if only a single activity is required to complete an operation.

  • Session - Specifies that user credentials, server settings and advanced preferences are obtained from a pre-configured session created in an earlier step with the use of the Email - Create session activity. This option is normally chosen if a combination of related activities are required to complete an operation. Linking several activities to a single session eliminates redundancy. Additionally, a single task supports construction and simultaneous execution of multiple sessions, improving efficiency.

Session

Text

Yes if Connection set to Session

EmailSession1

SESSION="emailSess1"

The name of the session. The default value is EmailSession1. This parameter is available only if the Connection parameter is set to Session.

Protocol

Text (options)

Yes if Connection set to Host

SMTP

  1. PROTOCOLTYPE="POP3"

  2. PROTOCOLTYPE="IMAP"

  3. PROTOCOLTYPE="WEBDAV"

  4. PROTOCOLTYPE="EWS"

The type of email protocol to connect to. This parameter is available only if the Connection parameter is set to Host. Different parameters become available depending on which option is chosen. The available options are:

  • POP3 (default) - An application-layer Internet standard protocol used by local email clients to retrieve email from a remote server over a TCP/IP connection. POP3 allows you to download email messages on your local computer and read them even when you are offline.

  • IMAP - IMAP (Internet Message Access Protocol) is a mail protocol used for accessing email on a remote web server from a local client.

  • WEBDAV (Exchange 2003, 2007) - WEBDAV (World Wide Web Distributed Authoring and Versioning) is the Internet Engineering Task Force standard for collaborative authoring on the Web.

  • EWS (Exchange 2007 & newer, Online) - EWS (Exchange Web Services) provides the functionality to enable client applications to communicate with the Exchange server. It provides access to much of the same data that is made available through Microsoft Outlook. EWS clients can integrate Outlook data into Line-of-Business (LOB) applications.

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 POP3 or IMAP.

Port

Number

No

110

PORT="3333"

The port that should be used when connecting to the SMTP server. Most SMTP servers run on port 110 (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 POP3 or IMAP.

Security

Text (options)

Yes

No security

  1. SECURITY="NONE"

  2. SECURITY="EXPLICI"

  3. SECURITY="IMPLICIT

The type of security that this action should use. This parameter is available only if the Protocol parameter is set to POP3 or IMAP. 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.

Authentication Type

Text (options)

Yes if Authentication is enabled

(Empty)

  1. AUTHTYPE="plain"

  2. AUTHTYPE="DigestMD5"

  3. AUTHTYPE="CramMD5"

  4. AUTHTYPE="Login"

  5. AUTHTYPE="ClearText"

  6. AUTHTYPE="APOP"

  7. AUTHTYPE="NTLM"

  8. AUTHTYPE="GSSapi"

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

  • Auto (default) - AutoMate will automatically determine the authentication type being used.

  • Plain - Consists of a single message from the client to the server. The client sends the authorization identity (identity to login as), followed by a US-ASCII Null character, followed by the authentication identity (identity whose password will be used), followed by a US-ASCII Null character, followed by the clear-text password. The client may leave the authorization identity empty to indicate that it is the same as the authentication identity."

  • DigestMD5 - An algorithm that is used to verify data integrity through the creation of a 128-bit message digest from data input (which may be a message of any length) that is claimed to be as unique to that specific data as a fingerprint is to the specific individual. During a DIGEST-MD5 authentication exchange between a client and the server, there is additional information passed which is used to construct a more robust hashing algorithm when compared against a CRAM-MD5 authentication making it more difficult to decipher.

  • CramMD5 - Challenge Response Authentication Mechanism is similar to DIGEST-MD5 in that it verifies data integrity through the creation of a 128-bit message digest.

  • Login - Authentication through logon credentials.

  • ClearText - Transmitted or stored text that has not been subjected to encryption and is not meant to be encrypted. As such, cleartext does not require decryption in order to be displayed.

  • APOP - Authenticated Post Office Protocol permits a client computer to retrieve email from a Post Office Protocol (POP) server while providing authentication technology that includes password encryption upon client receipt.

  • NTLM - Abbreviation for "Windows NT LAN Manager." NTLM is the default for network authentication in the Windows NT 4.0 operating system.

  • GSSapi - The Generic Security Service Application Program Interface is an application programming interface for programs to access security services.

  • OAuth20 - Provides a method for clients to access server resources on behalf of a resource owner (such as a different client or an end-user). It also provides a process for end-users to authorize third-party access to their server resources without sharing their credentials (typically, a username and password pair), using user-agent redirections.

Username

Text

Yes if Authentication is enabled

(Empty)

USERNAME="theuser"

The user name to use to logon to the mail server and authenticate the mail transaction.

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

Password

Text

Yes if Authentication is enabled

(Empty)

PASSWORD="encrypted"

The password used to logon to the mail server and authenticate the mail transaction.

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.

Certificate

Text

Yes if Security set to Explicit TLS/SSL or Implicit TLS/SSL

(Empty)

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.

Passphrase

Text

Yes if Security set to Explicit TLS/SSL or Implicit TLS/SSL

(Empty)

CERTIFICATEPASSPHRASE=

"encrypted"

The certificate passphrase. This parameter is available only if the Security parameter is set to Explicit TLS/SSL or Implicit TLS/SSL.

Current folder

Text

No

Inbox

CURRENTFOLDER="inbox"

Specifies the current mailbox folder that this activity should be performed on. The default value is Inbox. To denote other Exchange well-known folders (i.e. Calendar, Drafts, Tasks, etc.) enter the Exchange property name for that folder. To specify subfolders, use a "/" (i.e. Inbox/SubFolderName). For more details regarding Exchange "well-known" folders, see the Additional Notes section below.

Timeout

Number

No

60

TIMEOUT="120"

The specified period of time that will be allowed to elapse (in seconds) before the server will close a client connection. This ensures that connections do not persist forever, if the client crashes or the network goes down. Open connections consume resources, and may prevent other clients from accessing the same mailbox. The default value is 60 seconds.

If the Protocol parameter is set to WebDAV (Exchange 2003, 2007) or EWS (Exchange 2007 & newer, Online), the following parameters become available.

Email address

Text

Yes

(Empty)

EMAILADDRESS="guy@domain.com"

The email address to communicate with.

Exchange Server

Text

Yes

(Empty)

SERVER=

"https://www.server.com"

The Exchange server to communicate with. 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).

Impersonate

Yes/No

No

No

IMPERSONATE="YES"

If set to YES, Impersonation is enabled. Impersonation allows an account on an Exchange server to perform actions by using the permissions that are associated with another account, instead of the permissions that are associated with the caller's account. This parameter is set to NO by default and only available if the Protocol parameter is set to EWS (Exchange 2007 & newer, Online).

NOTE: With Exchange Impersonation, one account is acting as another account. When an account is impersonated, the system logs the access as if the account that is specified in the header were acting on the system. The calling account must have the appropriate permissions to perform impersonation.

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).

Authentication Type

Text (options)

No

(Empty)

  1. AUTHTYPE="basic"

  2. AUTHTYPE="default"

  3. AUTHTYPE="form"

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

  • Basic

  • Default

  • Form

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.

Proxy type

Text (options)

No

System default

  1. PROXYTYPE="socks4"

  2. PROXYTYPE="socks4a"

  3. PROXYTYPE="socks5"

  4. PROXYTYPE="http"

The 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

  • None

  • Socks4

  • Socks4a

  • Socks5

  • HTTP

Proxy server

Text

No

(Empty)

PROXYSERVER="proxy.host.com"

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

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 username

Text

No

(Empty)

PROXYUSERNAME="username"

The username that should be used to authenticate when connecting through the proxy server. This option is only valid if the Use authentication parameter is enabled.

Proxy password

Text

No

(Empty)

PROXYPASSWORD="encrypted"

The password that should be used to authenticate when connecting through the proxy server. This option is only valid if the Use authentication parameter is enabled.

Message

Property

Type

Required

Default

Markup

Description

From

Text

Yes

(Empty)

  1. FROM="me@mycompany.com"

  2. FROM="MyCompanyWebmaster <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="NetworkAutomationWebmaster <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.

Attachments

Property

Type

Required

Default

Markup

Description

Attachment

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.

Options

Property

Type

Required

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.

 

Description

Error Causes

On Error

Example

NOTE: The sample AML code below can be copied and pasted directly into the Steps panel 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>