Description |
Retrieves and/or removes e-mail messages from a POP3 mail box. A dataset is created and populated with the message information. The dataset can be scanned using the Loop Dataset Action and accessed by referencing %datasetname.field%. Note that messages will be processed even if they have already been processed unless the "Remove mail from server" check box is checked. Commonly used to build and Automated Workflow email attendant. Can automatically download and detect content of messages. Based on the content of the messages, an Automated Workflow reply (using SMTP Email <AMSMTPMAIL>) could be made or data could be written to a database (using SQL Query <AMSQLQUERY>). |
Declaration |
<AMPOP3MAIL ACTION="text" RESULTDATASET="test" ATTACHMENTDEST="text" SAVEMODE="text [options]" HOST="text" USER="text" PASSWORD="text" REMOVEMESSAGE="yes/no" PROXYTYPE="text" PROXYHOSTNAME="text" PROXYPORT="number"> |
Example |
<AMPOP3MAIL ACTION="all_messages" RESULTDATASET="MAILMESSAGES" ATTACHMENTDEST="c:\messageattachments" SAVEUNIQUE="YES" HOST="mail.server.com" USER="myusername" PASSWORD=" <AMLOOPDATASET DATASET="mailmessages"> <AMMESSAGEBOX MESSAGETEXT="The current message subject is %mailmessages.subject%." WINDOWTITLE="Current Message %mailmessages.CurrentRow%"> </AMLOOP> |
General Tab Parameters |
Action to take: Specifies the action to take place.
Text, Required Remove messages from Server: If retrieving messages, specifies that messages should be removed (deleted) from the POP3 server after they are downloaded. This option is ignored if ACTION= is set to remove_all_messages or remove_message. yes/no, Optional - Default No Host: Specifies the address of the POP3 mail server. This can be a host and domain name or IP address. Text, Required User name: Specifies the username that should be used when logging on to the POP3 Server. The Username should be preconfigured at the server level. Text, Required Password: Specifies the password that should be used when logging on to the POP3 Server. The Username should be preconfigured at the server level. When the step is created using the Designer it is written to the Workflow encrypted. Text, Required Port: Specifies the port that should be used to connect to the server. Most POP3 servers operate on port 110 (the default) however the mail server can be customized to operate on other ports. Number, Optional - Default 110 Message number: Specifies the index of the message to act on. This parameter is only valid if action is set to one_message or remove_message Text, Optional - Default "Default" Create and populate dataset with e-mail: Name of the dataset that should be created and populated with the mail message data upon execution. To access the data in subsequent steps simply specify %DATASETNAME.FIELDNAME% inside a Loop Dataset <AMLOOPDATASET> action (to recurse the rows). See Notes below for more information. Text, Required |
Attachments Tab Parameters |
**Available only when Get all messages or Get single message is specified on the General tab.** Save attachments in folder: Specifies the folder into which attachments should be saved. Click the Expression Builder icon to build and insert an expression. Text, Optional - Default (none) If file name already exists: Specifies how to handle an attachment if one already exists with the same filename.
Text [options], Optional - Default "ignore" |
Proxy Tab Parameters |
Proxy type: Specifies proxy protocol that should be used. If you are unsure of the value to use in this parameter, contact your network administrator.
Note: To create the most portable Workflows it is best to specify "system default" settings. By proceeding this way, Workflows created in one environment that may have a proxy server will be portable to others that do not - and vice-versa. Text [options], Optional - Default (none) Proxy host: Specifies the hostname (server.domain.com) or IP address (xxx.xxx.xxx.xxx) of the proxy server. Text, Optional - Default (blank) Proxy port: Specifies 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. Number, Optional - Default 1028 User ID (Proxy): Specifies 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. Text, Optional - Default (none) Password (Proxy): Specifies the password that should be used to authenticate when connecting through the proxy server. When the step is created using the Designer it is written to the Workflow encrypted. This option is only valid when Socks 5 is specified in the Proxy type as it is the only version that supports authentication. Text, Optional - Default (none) |
Notes |
A fixed field Dataset
is generated datasetname along with the standard fields included in every dataset |--CurrentRow A record (row) is created for each mail message that is retrieved from the server. To access this data use the Loop Dataset Action to loop through the records, inside the loop you can extract the data from the field of your choice (from the current record) by using an embedded expression as follows: %mydatasetname.subject% This can be used in any parameter in any action. So, to display the data in a message box the AML code would look like this: <AMMESSAGEBOX MESSAGETEXT="%mydatasetname.subject%" WINDOWTITLE="The Subject of the message is"> At runtime, the text %mydatasetname.subject% is replaced by the contents of the subject of the current record. |
See Also |