POP3 Icon

Get Email - Delete Messages

Declaration

<AMGETEMAIL ACTIVITY="remove_all_messages" PROTOCOLTYPE="webdav" EMAILADDRESS="text" SERVER="asa" CURRENTFOLDER="text" TIMOUT="number" DOMAINNAME="text" USERNAME="text" PASSWORD="AM2WknKdIcX3LQ=aME" PROXYTYPE="http" PROXYSERVER="assa" PROXYPORT="1080" PROXYUSERNAME="sasa" PROXYPASSWORD="AM2SEnYdJUX3LQ=aME" />

See Also

Get Email - Delete Messages | Get Email - Get All Headers | Get Email - Get Messages | Get Email - Get Single Message | Send Email | Send IM

Description

Deletes one or more messages from the server. This activity contains a filtering function that allows removal of specific messages based on the filter specified.

Practical Usage

Commonly used to remove multiple or all messages from the server.

Parameters

Email Properties

Property

Type

Required

Default

Markup

Description

Create and populate dataset

Text

No

(Empty)

RESULTDATASET="mydataset"

The name of the dataset to create and populate with the results of this activity.

Remove mail from server

Yes/No

No

No

REMOVEMESSAGE="yes"

If set to YES, specifies that mail will be permanently removed from the serve. This parameter is set to NO by default.

 

Server Properties

Property

Type

Required

Default

Markup

Description

Protocol

Text (options)

Yes

SMTP

PROTOCOLTYPE="SMTP"

The protocol type to connect to. 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:

  • POP3 (Default)

  • SMTP

  • Exchange 2003 (WebDav)

  • Exchange 2007 (EWS)

  • Exchange 2010 (EWS)

If the Protocol selected is POP3 or SMTP, the following parameters become available.

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.

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.

Authentication type

Text (options)

No

Auto

AUTHENTICATIONTYPE="NTLM"

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="theuser"

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.

Filter Properties

Property

Type

Required

Default

Markup

Description

From

Text

No

(Empty)

FROM="me"

Retrieve mail that contains the specified email address in the From field.

To

Text

No

(Empty)

TO="you"

Retrieve mail that contains the specified email address entered in the To field.

Subject

Text

No

(Empty)

PASSWORD="encrypted"

Retrieve mail that contains the specified words in the Subject field.

Body

Text

No

(Empty)

BODY="text2"

Retrieve mail that contains the specified text in the body.

CC

Text

No

(Empty)

CC="text3"

Retrieve mail that contains the specified email address entered in the CC field.

Bcc

Text

No

(Empty)

BCC="text4"

Retrieve 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 mail only if it that attachments.

Has been read

Yes/No

No

No

HASBEENREAD="yes"

If set to YES, retrieve mail only if it has been read.

Only if newer than

Date

No

(Empty)

IFNEWERTHAN=

"%DateSerial(2010,12,22)

+TimeSerial(14,21,03)%"

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

Proxy Properties

Property

Type

Required

Default

Markup

Description

Proxy type

Text (options)

No

System default

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 host

Text

No

(Empty)

PROXYSERVER="proxy.host.com"

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

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.

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

 

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

Well-Known Mailbox Folders

Each user's mailbox folder has a set of properties that you can use to retrieve well-known folders such as Inbox, Calendar, Drafts, and Tasks. Specifying a subfolder requires the name of the appropriate folder from the well known folders level as the parent folder and use of a "/" sign as a delimiter (i.e. Inbox/SubFolderName). To specify a folder that you created in the well known folders level, you must specify the root of the message folder hierarchy (i.e. MsgFolderRoot/SubFolderName). The table below defines common folder names (in alphabetical order) that are used in users' mailboxes.

Name

Description

ArchiveDeletedItems

The Deleted Items folder in the archive mailbox.

ArchiveMsgFolderRoot

The root of the message folder hierarchy in the archive mailbox.

ArchiveRecoverableItemsDeletions

The root of the folder hierarchy of recoverable items that have been soft-deleted from the Deleted Items folder of the archive mailbox.

ArchiveRecoverableItemsPurges

The root of the hierarchy of recoverable items that have been hard-deleted from the Deleted Items folder of the archive mailbox.

ArchiveRecoverableItemsRoot

The root of the Recoverable Items folder hierarchy in the archive mailbox.

ArchiveRecoverableItemsVersions

The root of the Recoverable Items versions folder hierarchy in the archive mailbox.

ArchiveRoot

The root of the folder hierarchy in the archive mailbox.

Calendar

The Calendar folder.

Contacts

The Contacts folder.

DeletedItems

The Deleted Items folder.

Drafts

The Drafts folder.

Inbox

The Inbox folder.

Journal

The Journal folder.

JunkEmail

The Junk E-mail folder.

MsgFolderRoot

The root of the message folder hierarchy.

Notes

The Notes folder.

Outbox

The Outbox folder.

PublicFoldersRoot

The root of the Public Folders hierarchy.

RecoverableItemsDeletions

The root of the folder hierarchy of recoverable items that have been soft-deleted from the Deleted Items folder.

RecoverableItemsPurges

The root of the folder hierarchy of recoverable items that have been hard-deleted from the Deleted Items folder.

RecoverableItemsRoot

The root of the Recoverable Items folder hierarchy.

RecoverableItemsVersions

The root of the Recoverable Items versions folder hierarchy in the archive mailbox.

Root

The root of the mailbox.

SearchFolders

The Search Folders folder, also known as the Finder folder.

SentItems

The Sent Items folder.

Tasks

The Tasks folder.

Voicemail

The Voicemail folder.

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: Imap E-mail. Remove all messages from "mail.server.com". Port number "143". User name "user".

 

<AMGETEMAIL ACTIVITY="remove_all_messages" IFOLDERTHAN="%DateAdd( &quot;d&quot;, -30, CStr( Now() ))%" PROTOCOLTYPE="imap" SERVER="mail.server.com" PORT="143" USERNAME="user" PASSWORD="AM2SEnYdJUXvbJISdh0lRevslpJuXTmF9ywaME" PROXYTYPE="http" PROXYSERVER="assa" PROXYPORT="1080" PROXYUSERNAME="sasa" PROXYPASSWORD="AM2SEnYdJUX3LQ=aME" />

 

↑ Top of Page