Email - Get Header(s)
Declaration
<AMEMAIL SESSION="text" RESULTDATASET="text" REMOVEMESSAGE="YES/NO" FROM="text" TO="text" SUBJECT="text" CC="text" IFNEWERTHAN="DateSerial" IFOLDERTHAN="DateSerial" />
Description: Retrieves all message headers (e.g., Subject, Date, To and From information) and populates a dataset with results. This is a fast and efficient way to determine what is on the server without downloading potentially large message bodies and/or attachments.
Practical Usage
Commonly used to save all message headers into a dataset. The dataset can be looped through for further processing.
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:
|
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 |
|
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:
|
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 |
|
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:
|
Authentication Type |
Text (options) |
Yes if Authentication is enabled |
(Empty) |
|
Specifies the authentication type to administer. The following options are:
|
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 (e.g., Calendar, Drafts, Tasks, etc.) enter the Exchange property name for that folder. To specify subfolders, use a "/" (e.g., 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, Exchange Impersonation is enabled, allowing 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. |
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) |
|
Specifies the authentication type to administer. The following options are:
|
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 |
|
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:
|
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. |
Email Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Create and populate dataset |
Text |
Yes |
(Empty) |
RESULTDATASET="theData" |
The name of the dataset in which to create and populate with retrieved header information. |
Remove mail from server |
Yes/No |
Yes |
(Empty) |
REMOVEMESSAGE="yes" |
If set to YES, specifies that mail will be permanently removed from the serve. This parameter is set to NO by default. |
Filter Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
From |
Text |
No |
(Empty) |
FROM="me" |
Retrieve header information from mail that contains the specified email address in the From field. |
To |
Text |
No |
(Empty) |
TO="you" |
Retrieve header information from mail that contains the specified email address entered in the To field. |
Subject |
Text |
No |
(Empty) |
PASSWORD="encrypted" |
Retrieve header information from mail that contains the specified words in the Subject field. |
Body |
Text |
No |
(Empty) |
BODY="text2" |
Retrieve header information from mail that contains the specified text in the body. |
CC |
Text |
No |
(Empty) |
CC="text3" |
Retrieve header information from mail that contains the specified email address entered in the CC field. |
Bcc |
Text |
No |
(Empty) |
BCC="text4" |
Retrieve header information from mail that contains the specified email address entered in the Bcc field. |
Has attachments |
Yes/No |
No |
No |
HASATTACHMENT="yes" |
If set to YES, retrieve header information from mail only if it contains an attachment. |
Has been read |
Yes/No |
No |
No |
HASBEENREAD="yes" |
If set to YES, retrieve header information from mail only if it has been read. |
Only if newer than |
Date |
No |
(Empty) |
IFNEWERTHAN= "%DateSerial(2010,12,22) +TimeSerial(14,21,03)%" |
Retrieve header information from mail only if newer than the date/time specified. Click the Custom button to select from a list of custom date/time intervals. Enable the Expression option to enter a specific date/time expression. |
Only if older than |
Date |
No |
(Empty) |
IFOLDERTHAN= "%DateSerial(2010,12,22) +TimeSerial(14,21,03)%" |
Retrieve header information from mail only if older than the date/time specified. Click the Custom button to select from a list of custom date/time intervals. Enable the Expression option to enter a specific date/time expression. |
Example
The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.
Pop3 E-mail. Retrieve all headers from "mail.server.com". User name "user". Store in dataset "theDataset".
<AMGETEMAIL RESULTDATASET="theDataset" SERVER="mail.server.com" USERNAME="user" PASSWORD="AM2SEnYdJUXvbJISdh0lRevslpJuXTmF9ywaME" />