Вы просматриваете старую версию данной страницы. Смотрите текущую версию.

Сравнить с текущим просмотр истории страницы

« Предыдущий Версия 3 Следующий »

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

"Context" field - email connection context identifier.

"From" field - selects emails whose sender email address fully matches or contains the provided value.

"To" field - selects emails whose recipient’s email address fully matches or contains the provided value. To specify more than one item, use ";" or ",".

"CC" field - selects 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 ",".

"Subject" field - selects messages whose subject line fully matches or contains the provided value.

"Body" field - selects emails for which the text of the email body fully matches or contains the provided value.

"Attachment name" field - selects messages with attachment names fully match or contains the provided value.

"Unread only" field - if "true", only unread emails will be selected. If the value is "false", both read and unread e-mails will be selected.

"Count" field - the number of emails that must be read from the mailbox using the specified filters.

"Folder For Attachment" field - the path to the folder in which subfolders will be created to save attachments from letters.

"Include html text" field - if 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 template" field - if 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 date" field. Not mandatory. Description: "The messages that are received starting from the specified date and time will be selected". Data type: Date-Time.

"Ending date" field. Not mandatory. Description: "Messages received before the specified date and time inclusive will be selected". Data type: Date-Time.

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. Настроить параметры для действия "Получить сообщение".
    Настройка действия:

    a. параметр "Контекст". Необходимо выбрать из выпадающего списка контекст соответствующий почтовому ящику с которого будут вычтены сообщения;

    b. параметр "От". Указываем почтовый ящик отправителя сообщения;

    c. параметр "Кому". Указываем почтовый ящик получателя сообщения;

    d. параметр "Тема". Указываем значение "Сотрудник";

    e. параметр "Название вложения". Указываем маску файлов. ".png";

    f. параметр "Папка для сохранения вложений". Указываем путь до папки, в которую будут сохранены вложения

    g. Параметр "Начиная с даты". Указываем дату, поиск с которой будет осуществлен с даты/времени указанных в "Начиная с даты" и до даты/времени указанных в "Заканчивая датой" включительно.

    h. Параметр "Заканчивая датой". Указываем дату, поиск до которой будет осуществлен с даты/времени указанных в "Начиная с даты" и до даты/времени указанных в "Заканчивая датой" включительно.

    i. параметр "Результат". Указываем переменную "Таблица", в которую будет сохранена информация из писем.




  4. Нажать на кнопку "Старт" в верхней панели. 

Результат

Требуемые письма получены и сохранены в таблицу, в которую сохраняется информация из писем, отобранных по выбранным фильтрам. Вложения из писем сохранены в целевую папку.

  • Нет меток