Основной сайт хуманэмулятор.рф | Демо | Купить | API | Wiki
Web / outlook
get_message_as_msg_file_by_number
get_message_as_msg_file_by_number($folder,$folder_to_save,$number,$readed="all",$timeout=300); - Получить письмо по номеру как файл .msgВарианты значений $readed:
"all" - получить все сообщения;
"unreaded" - получить непрочитанные сообщения;
"readed" - получить прочитанные сообщения.
Функция на вход принимает параметры:
После выполнения функции возвращаемое значение будет равно одному из двух :
Пример использования
<?php // Scenario: Get and save a message as .msg file from Outlook by folder and number $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 number $outlookFolder = "\\\\test@mail.ru\\Inbox"; $folderPath = "test"; $messageNumber = 0; echo("\n\nExample 1. Get and save a message as .msg file from Outlook by folder 'Inbox' and number '0': "); $getResult = WEB::$outlook->get_message_as_msg_file_by_number($outlookFolder, $folderPath, $messageNumber); 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(); ?>
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7026" from xweb_human_emulator import * # начало echo("<hr><font color=blue>outlook.get_message_as_msg_file_by_number</font><hr>") # 1. Открыть outlook echo("1. Открыть outlook: ") echo(outlook.open(False)) # 2. Пример 1. Получить и сохранить сообщение как .msg файл из Outlook по папке и номеру outlookFolder = "\\test@mail.ru\\Inbox" folderPath = "test" messageNumber = 0 echo("\n\n2. Пример 1. Получить и сохранить сообщение как .msg файл из Outlook по папке 'Inbox' и номеру '0': ") getResult = outlook.get_message_as_msg_file_by_number(outlookFolder, folderPath, messageNumber) if getResult: echo("\n Получить сообщение успешно. Файл можно найти по пути: " + getResult) else: echo("\n Получить сообщение не удалось") echo("\n") # Quit app.quit()
#region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program:XHEScript { static void Main(string[] args) { // init XHE server = Environment.GetEnvironmentVariable("RPABOT_HOST_URL"); InitXHE(); // начало echo("<hr><font color=blue>outlook->get_message_as_msg_file_by_number</font><hr>"); // 1 echo("1. Get and save a message as .msg file from Outlook by folder 'Inbox' and number '0': "); string result = outlook.get_message_as_msg_file_by_number("\\\\test@mail.ru\\Inbox", "test", 0); if (!string.IsNullOrEmpty(result)) echo("\n Get message success. File can find at path: " + result); else echo("\n Get message fail"); // конец echo("\n"); // Quit app.quit(); } }
xhe_host = "127.0.0.1:3039";
echo=require("../../../Templates JS/init.js");
// начало
echo("<hr><font color=blue>outlook->get_message_as_msg_file_by_number</font><hr>");
// 1 шаг
echo("1. Откроем приложение Outlook : ");
echo(outlook.open(false));
// Пример 1. Получим и сохраним сообщение как .msg файл из Outlook по папке и номеру
outlookFolder = "\\\\test@mail.ru\\Inbox";
folderPath = "test";
messageNumber = 0;
echo("\n\n2. Получим и сохраним сообщение как .msg файл из Outlook по папке 'Inbox' и номеру '0': ");
getResult = outlook.get_message_as_msg_file_by_number(outlookFolder, folderPath, messageNumber);
if (getResult)
echo("\n Получение сообщения успешно. Файл можно найти по пути: " + getResult);
else
echo("\n Получение сообщения не удалось");
// конец
echo("\n");
// Quit
app.quit();=============================================
outlook Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.