Get message Version 16 (Net)
Action group: Mail
Description
This action reads emails from the mailbox that match the specified filters and saves them to a variable of type Table. To retrieve the data written to the variable of the Table type, use the action Table to CSV Tables
In order for the "Get message" action to work correctly, it is necessary to initially set up a connection to the email using the action Open email (Net) Mail
Action icon
Action parameters
Input parameters
- "Context" field - identifier of the session of work with the email server. The field specifies the context of the "Connection settings" action.
- "From" field - the mail address of the email sender. To specify more than one item, use ";" or ","
- "To" field - the email address of the recipient of the message. To specify more than one element, use ";" or ",".
- "CC" field - the email address of the recipient of the copy of the letter. To specify more than one element, use ";" or ",".
- "Subject" field - the subject of the email.
- "Body" field - the text of the email.
- "Attachment name" field - the name of the attachment in the email.
- "Unread only" field - if the checkbox = true, only unread emails will be selected.
- "Count" field - the number of emails that should be read from the mailbox according to the specified filters.
- "Folder For Attachment" field - the path to the folder where subfolders for saving attachments from emails will be created.
- "Include html text" field - this checkbox includes full information about styles. Otherwise, just text will be received.
The "Include html text" checkbox is checked
the "Include html text" checkbox is unchecked
- "Save images" field - if the value is "true", the images from the message body will be saved, otherwise they will not be saved.
- "Starting date" field - The messages that are received starting from the specified date and time will be selected.
- "Ending date" field - Messages received up to and including the specified date and time will be selected.
Output parameters
Results table - a table where information from emails selected by selected filters is saved. The table has the following set of columns:
- ID - email identifier.
- From - email address of the sender.
- To - email addresses of all primary recipients.
- CC - email addresses of all recipients of the email copy.
- Subject - subject of the email;
- Body - body of the email.
- Path - path to the generated subfolder where attachment files were saved.
- DateTime - date and time when the email was received.
Example of a saved table in CSV (action "Save table to CSV").
Settings
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Context | Email connection context identifier | Robin.Email | Email context | Yes |
From | Selects emails whose sender email addresses match the specified regular expression. To specify more than one item, use «;» or «,» | Robin.String | No | |
To | Selects messages whose recipient’s mailing address matches the specified regular expression. To specify more than one item, use «;» or «,» | Robin.String | No | |
CC | Selects emails whose addresses of the recipients of the email copy match the specified regular expression. To specify more than one item, use «;» or «,» | Robin.String | No | |
Subject | Selects messages whose subject line matches the specified regular expression. | Robin.String | No | |
Body | Selects emails for which the text of the email body matches the specified regular expression. | Robin.String | No | |
Attachment name | Selects messages with attachment names that match the specified regular expression. | Robin.String | No | |
Unread only | Selects unread emails only | Robin.Boolean | true | No |
Count | The number of emails that must be read from the mailbox using the specified filters. | Robin.Numeric | No | |
Folder For Attachment | The path to the folder in which subfolders will be created to save attachments from letters. | Robin.FolderPath | C:\doc\img | No |
Include html text | Include full body with html | Robin.Boolean | true | No |
Save images | If the value is «true», then the images from the message body will be saved, otherwise they will not be saved. | Robin.Boolean | true | No |
Starting date | The messages that are received starting from the specified date and time will be selected. | Robin.DateTime | No | |
Ending date | Messages received before the specified date and time inclusive will be selected. | Robin.DateTime | No | |
Results | ||||
Results table | 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’s mailing address; - To - mailing addresses of all main recipients; - CC - mailing addresses of all recipients of the copy of the letter; - Subject - the subject of the letter; - Body - the body of the letter; - Path - the path to the generated subfolder in which the attachment files were saved; - DateTime – date and time when the message was received. | Robin.DataTable | ||
Number of messages | The number of messages found. | Robin.Numeric |
Action parameters of previous versions
Eng_Получить сообщение Версии1-15
Special conditions of use
None.
Example of use
Task
Get all emails from the mail for a given time interval and save the information from the emails to a table (CSV) and display a dialog box with the number of found messages.
Solution
Connect the mailbox from which you want to receive emails. For any actions with a particular mailbox, you should first connect to it, create its unique identifier (Context).
Define a postal service. (The parameters of connection to the mailbox depend on the postal service).
Receive emails corresponding to the specified filters.
Implementation
Use the actions: "Open email", "Get message", "Show message", "Table to CSV".
- Assemble a robot scheme consisting of actions:
- Configure the settings for the "Connection settings" action. (see the description of the action Настройки подключения / Connection settings).
- Set the parameters for the "Get message" action.
Set the action parameters:
- "Context" parameter. It is necessary to select from the dropdown list the context corresponding to the mailbox from which the messages will be deducted;
- "From" parameter. Specify the mailbox of the message sender;
- "Starting date" parameter. Specify the starting date of the interval;
- "Ending date" parameter. Specify the end date of the interval;
- "Results table" parameter. Specify the "Table" variable where the information from the emails will be saved;
- "Number of messages" parameter. Specify the "Count" variable, into which the information about the number of messages will be saved.
- Set the parameters of the "Message" action.
- Set the parameters of the "Table to CSV" action.
- Click on the "Start" button in the top panel.
Result
The required emails are retrieved and saved in a CSV format table, which saves information from the emails selected by the selected filters.
A form with the number of found messages is also displayed.