The ReadEmail function will connect to a mail server using either IMAP or POP3.

IMAP (Internet Message Access Protocol) provides access and retrieve mail functions for a remote mail server so the mails can be used locally while retaining them also on the server. Imap sets message flags so that the user can keep track of which messages he or she has already seen, already answered, and so on.

POP (Post Office Protocol) implements the offline mail access model, where mail is retrieved and then deleted from the server where the mailbox resides so it can be used on a local machine. Emails are hence transferred permanently from a central server to one client machine.


Mail server settings


Protocol to use when reading the email.


The type of authentication needs to be one that the mail server is capable of.

User name

The user name for the mailbox you wish to access.


The password for the mailbox you wish to access.


The port number used to access the mailbox.

Server name

The IP address, URL or network name of the server.


Using SSL (Secure Socket Layer) is more secure as the data is encrypted.



The email folder on the server where the mails you wish to retrieve are stored (IMAP only).

Only unread items

A flag to indicate whether only unread mails should be retrieved (IMAP only).

Mark as read

A flag to indicate whether retrieved emails should be marked as 'read' (IMAP only).

Move to folder

A folder to move retrieved emails to (IMAP only).

Delete after read

A flag to indicate whether retrieved emails should be deleted from the original folder.

Body as HTML

A flag to indicate if the email's body should be retrieved formatted in HTML. Otherwise, the body will be retrieved as unformatted text.

Attachment options

Three actions are available for attachments.

None will ignore attachments.

SaveToFile will save the attachments as files to the specified directory. The filepath is an automatic output of this function and can be used to use an attachment later in the process.

ReturnData will convert the attachment contents to a string and allow you to use that string further down in your process. This option will only work for text-based attachments, not binary ones.

Save email

A flag to indicate if the emails should be saved to disk.

File directory

The directory where emails and attachments will be saved. For emails, the subject line becomes the filename. Attachments already have filenames that will be used when saving.

If a file of that name already exists, the function will add the year, month, day, hour, second and milliseconds to the filename in this format yyyy-mm-dd-hh-ss-ffff to make sure it is unique.

If the filename is too long, it will be truncated.

Email file type

The file type used when saving emails to disk.

Regex filters

Regex filters allow you to retrieve emails containing specific information.

The regular expression matching is case sensitive by default. Use the case insensitive mode modifier (?i) to force case insensitive matching.

Filter body

Information to look for in the body of the emails.

Filter from

Information to look for in the from field of the emails.

Filter from address

Information to look for in the from address fields of the emails.

Filter subject

Information to look for in the subject line of the emails.

Filter to

Information to look for in the to field of the emails.

Regex filters operator

Filter option

If you have specified multiple RegEx search criteria, you can define whether these should be chained together with an AND or with an OR. AND means that all filters need to be true for the mail to be retrieved. OR means that ANY of the filters need to be true for the mail to be retrieved.

Reading Gmail emails

For email providers using two-factor authentication (such as Gmail), you will need to complete additional steps to bypass further security settings.

To set up your Gmail account for use by your Linx applications, there are 2 options:

1. Allow less secure apps

In your Gmail account:

  • Select Sign-in and Security

  • Switch off 2-Step verification

  • Scroll down and set “Allow less secure apps” to “On”


2. Create an App password

(This is the recommended option.)

Go to the Google Account section:

  • Select Security

  • Make sure 2-Step Verification is switched 'On'

  • Select App passwords

  • Verify yourself

  • Select 'Other'

  • Provide a name (e.g. Linx)

  • Click Generate

  • The password that you have to use in Linx will display

Note: After setting up your App password, you can switch 2-Step Verification 'Off' again.

In Linx Designer

Set the following properties:

  • Protocol: Imap

  • Enable SSL

  • Port 993

  • SMTP server:

Also see

Linx Community: Email plugin configuration

Linx Community: Email filtering