Get message Version 6 (Java)

Action group: Email 


Description

The action reads emails that match the specified filters from the mailbox and saves them to the Table type variable.

Action icon

Action parameters

Input parameters

ParameterDescription
ContextEmail connection context identifier.
FromSelects emails whose sender email address fully matches or contains the provided value.
ToSelects emails whose recipient’s email address fully matches or contains the provided value. To specify more than one item, use ";" or ",".
CCSelects emails whose addresses of the recipients of the email copy fully match or contains the provided value. To specify more than one item, use ";" or ",".
SubjectSelects messages whose subject line fully matches or contains the provided value.
BodySelects emails for which the text of the email body fully matches or contains the provided value.
Attachment nameSelects messages with attachment names fully match or contains the provided value.
Unread onlyIf "true", only unread emails will be selected. If the value is "false", both read and unread emails will be selected.
CountThe number of emails that must be read from the mailbox using the specified filters.
Folder For AttachmentThe path to the folder in which subfolders will be created to save attachments from letters.
Include html textIf the value is "true", the action will return an email text with full information about the styles of that text . If the value is "false", the action will return plain text.
Search by templateIf the value is "true", the values in the search filters will be treated as regular expressions when selecting emails. If the value is "false", the values in the search filters will be considered as plain text, and the search speed will also increase when connecting with IMAP protocol.
Starting dateThe messages that are received starting from the specified date and time will be selected.
Ending dateMessages received before the specified date and time inclusive will be selected.

Output parameters

Result - A table into which information is saved from letters selected by the selected filters. The table has the following set of columns: ID - message identifier; From - sender; To - recipient (list of all); CC - recipient of a copy of the letter; Subject - subject of the letter; Body - the body of the letter; Path - path to the folder with the attachment files. DateTime - received date and time.

"Number of messages" field - the number of messages found.

Settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextEmail connection context identifierRobin.JavaMail
Yes
FromSelects emails whose sender email address fully matches or contains the provided valueRobin.String
No
ToSelects emails whose recipient’s email address fully matches or contains the provided value. To specify more than one item, use ";" or ","Robin.String
No
CCSelects emails whose addresses of the recipients of the email copy fully match or contains the provided value. To specify more than one item, use ";" or ","Robin.String
No
SubjectSelects messages whose subject line fully matches or contains the provided value.Robin.String
No
BodySelects emails for which the text of the email body fully matches or contains the provided value.Robin.String
No
Attachment nameSelects messages with attachment names fully match or contains the provided valueRobin.String
No
Unread onlySelects unread emails onlyRobin.BooleantrueNo
CountThe number of emails that must be read from the mailbox using the specified filters.Robin.Numeric
No
Folder For AttachmentThe path to the folder in which subfolders will be created to save attachments from letters.Robin.FolderPathC:\doc\imgNo
Include html textInclude full body with html tags if applicableRobin.BooleantrueNo
Search by templateIf "true" search by provided template, if "false" search as substringRobin.BooleantrueNo
Starting dateThe messages that are received starting from the specified date and time will be selected.Robin.DateTime
No
Ending dateMessages received before the specified date and time inclusive will be selected.Robin.DateTime
No
Results
ResultA table into which information is saved from letters selected by the selected filters. The table has the following set of columns: - ID - Message identifier; - From - Sender; - To - Recipient (list of all); - CC - Recipient of a copy of the letter; - Subject - Subject of the letter; - Body - The body of the letter; - Path - Path to the folder with the attachment files. - DateTime - received date and timeRobin.DataTable

Number of messagesThe number of messages found.Robin.Numeric


Special conditions of use

None.


Example of use 

Task

Get all messages from testsforrobin@mail.ru with subject "Employee" and PNG-files in the attachments. Files from the messages to save to the folder.

Solution

Connect the mailbox from which you want to receive emails. For any actions with a particular mailbox, connect to it first, create its unique identifier (Context).

Define the mail service. (Connection parameters to the mailbox depend on the mail service).

Get emails matching the specified filters.

Implementation

  1. Assemble a robot scheme withe the actions:


  2. Set the "Open email" action parameters. (for action description go to Connection settings). 

  3. Set the "Get message" action parameters.
    Action setting:

    a. "Context" parameter. Select from the drop-down list the context corresponding to the mailbox from which the messages will be deducted;

    b. "From" parameter. Specify the mailbox of the message sender;

    c. "To" parameter. Specify the mailbox of the message recipient;

    d. "Subject" parameter. Specify the value "Employee";

    e. "Attachment name" parameter. Specify the file mask. ".png";

    f. "Folder For Attachment" parameter. Specify the path to the folder where the attachments will be saved;

    g. "Starting date" parameter. Specify the date to be searched from the date/time specified in "Starting date" up to and including the date/time specified in "Ending date";

    h. "Ending Date" parameter. Specify the date to be searched from the date/time specified in "Starting date" up to and including the date/time specified in "Ending date";

    i. "Result" parameter. Specify the "Table" variable where the information from emails will be saved;




  4. Click "Start" in the top panel.

Result

The required emails are received and saved to a table that stores information from emails selected by the specified filters. Attachments from emails are saved to the target folder.

  • Нет меток