Основной сайт хуманэмулятор.рф | Демо | Купить | API | Wiki
Web / outlook
get_message_as_msg_file_by_attachment_name
get_message_as_msg_file_by_attachment_name($folder,$folder_to_save,$name,$exactly=false,$number=0,$readed="all",$timeout=300); - Получить письмо с заданным именем вложения как файл .msgВарианты значений $readed:
"all" - получить все сообщения;
"unreaded" - получить непрочитанные сообщения;
"readed" - получить прочитанные сообщения.
Функция на вход принимает параметры:
После выполнения функции возвращаемое значение будет равно одному из двух :
Пример использования
<?php // Scenario: Get and save a message as .msg file from Outlook by folder and attachment name $xhe_host = getenv("RPABOT_HOST_URL"); if (!isset($path)){ // Path to the init.php file for connecting to the XHE API $path = "../../../Templates/init.php"; // Including init.php grants access to all classes and functionality for working with the XHE API require($path); } echo "\n<span>outlook->" . basename (__FILE__) . "</span>\n"; // Step 1. Open Outlook app echo("Open Outlook app: "); $openResult = WEB::$outlook->open(false); if ($openResult) echo("\n Open Outlook app is success"); else echo("\n Open Outlook app is fail"); // Example 1. Get and save a message as .msg file from Outlook by folder and attachment name $outlookFolder = "\\\\test@mail.ru\\Inbox"; $folderPath = "test"; $attachmentName = "png"; $exactMatch = false; $timeout = 0; $readFlag = "all"; echo("\n\nExample 1. Get and save a message as .msg file from Outlook by folder 'Inbox' and attachment name 'png': "); $getResult = WEB::$outlook->get_message_as_msg_file_by_attachment_name($outlookFolder, $folderPath, $attachmentName, $exactMatch, $timeout, $readFlag); if ($getResult) echo("\n Get message success. File can find at path: $getResult"); else echo("\n Get message fail"); // Example 2. Get and save a message with exact attachment name match $attachmentNameExact = "image.png"; $exactMatchExact = true; echo("\n\nExample 2. Get and save a message with exact attachment name match: "); $getResult = WEB::$outlook->get_message_as_msg_file_by_attachment_name($outlookFolder, $folderPath, $attachmentNameExact, $exactMatchExact, $timeout, $readFlag); if ($getResult) echo("\n Get message success. File can find at path: $getResult"); else echo("\n Get message fail"); echo "\n"; // Quit WINDOW::$app->quit(); ?>
=============================================
outlook Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.