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

  1. "Context" field - identifier of the session of work with the email server. The field specifies the context of the "Connection settings" action. 
  2. "From" field - the mail address of the email sender. To specify more than one item, use ";" or ","
  3. "To" field - the email address of the recipient of the message. To specify more than one element, use ";" or ",".
  4. "CC" field - the email address of the recipient of the copy of the letter. To specify more than one element, use ";" or ",".
  5. "Subject" field - the subject of the email. 
  6. "Body" field - the text of the email. 
  7. "Attachment name" field - the name of the attachment in the email. 
  8. "Unread only" field - if the checkbox = true, only unread emails will be selected. 
  9. "Count" field - the number of emails that should be read from the mailbox according to the specified filters.
  10. "Folder For Attachment" field - the path to the folder where subfolders for saving attachments from emails will be created.
  11. "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
     
  12. "Save images" field - if the value is "true", the images from the message body will be saved, otherwise they will not be saved.
  13. "Starting date" field - The messages that are received starting from the specified date and time will be selected.
  14. "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:

  1. ID - email identifier.
  2. From - email address of the sender.
  3. To - email addresses of all primary recipients.
  4. CC - email addresses of all recipients of the email copy.
  5. Subject - subject of the email; 
  6. Body - body of the email.
  7. Path - path to the generated subfolder where attachment files were saved.
  8. DateTime - date and time when the email was received.

Example of a saved table in CSV (action "Save table to CSV"). 


Settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextEmail connection context identifierRobin.EmailEmail contextYes
FromSelects emails whose sender email addresses match the specified regular expression. To specify more than one item, use «;» or «,»Robin.String
No
ToSelects messages whose recipient’s mailing address matches the specified regular expression. To specify more than one item, use «;» or «,»Robin.String
No
CCSelects 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
SubjectSelects messages whose subject line matches the specified regular expression.Robin.String
No
BodySelects emails for which the text of the email body matches the specified regular expression.Robin.String
No
Attachment nameSelects messages with attachment names that match the specified regular expression.Robin.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 htmlRobin.BooleantrueNo
Save imagesIf the value is «true», then the images from the message body will be saved, otherwise they will not be saved.Robin.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
Results tableA 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 messagesThe 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".

  1. Assemble a robot scheme consisting of actions:
  2. Configure the settings for the "Connection settings" action. (see the description of the action Настройки подключения / Connection settings). 
    image2024-1-31_12-13-35.png
  3. Set the parameters for the "Get message" action.

    Set the action parameters:

    1. "Context" parameter. It is necessary to select from the dropdown list the context corresponding to the mailbox from which the messages will be deducted;
    2. "From" parameter. Specify the mailbox of the message sender;
    3. "Starting date" parameter. Specify the starting date of the interval;
    4. "Ending date" parameter. Specify the end date of the interval;
    5. "Results table" parameter. Specify the "Table" variable where the information from the emails will be saved;
    6. "Number of messages" parameter. Specify the "Count" variable, into which the information about the number of messages will be saved.

  4. Set the parameters of the "Message" action.
  5. Set the parameters of the "Table to CSV" action.
  6. 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.

  • Нет меток