humanemulator.net — справка. Продукт, демо и покупка — на хуманэмулятор.рф | Демо | Купить | API | Changelog

reply

reply($folder,$id,$subject,$message,$type,$cc="",$bcc="",$attachments=array(),$replyAll=false,$timeout=300); - E-mail

: subject , RE { } !
$type:
1 - ;
2 - HTML.

:

  • $folder ,
  • $id ID
  • $subject
  • $message
  • $type E-mail
  • $cc
  • $bcc
  • $attachments -
  • $replyAll ?
  • $timeout ,

    :
  • true
  • false

    Пример использования
    <?php
    // Scenario: Reply to an email message
    $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);
    }
    
    // Beginning
    echo "\n<font color=blue>msexchange->" . basename (__FILE__) . "</font>\n";
    
    // Access credentials
    require("./in/login.php");
    
    global $ms_api_url, $ms_api_user_name_or_email, $ms_api_user_password, $ms_api_userDomain, $useAutodiscoverEWSUrl;
    
    try{
        // Step 1: Connect to MS Exchange
        echo("Step 1: Connect to MS Exchange: ");
        $isConnected = WEB::$msexchange->connect($ms_api_url, $ms_api_user_name_or_email, $ms_api_user_password, $ms_api_userDomain, $useAutodiscoverEWSUrl);
        var_export($isConnected);
        if ($isConnected) {
    
            // Step 2: Get message by index to get message ID
            echo("\nStep 2: Get message by index 0 from folder 'TEST_DOLENKO' to get message ID: ");
            $folderName = "TEST_DOLENKO";
            $messageIndex = 0;
            $mes = WEB::$msexchange->get_message_by_number($folderName, $messageIndex);
            if ($mes != null) {
                var_export($mes);
                // Example 1: Reply to message
                echo("\nExample 1: Reply to message: ");
                $replyToAll = 1;
                $fromAddress = $ms_api_user_name_or_email;
                $ccAddress = "";
                $attachments = array();
                $saveCopy = false;
                echo(WEB::$msexchange->reply($folderName, $mes->message_id, "", "REPLY", $replyToAll, $fromAddress, $ccAddress, $attachments, $saveCopy) . "\n");
            }
        }
    }
    finally
    {
        // Step 3: Disconnect from MS Exchange
        echo("\nStep 3: Disconnect from MS Exchange: ");
        echo(WEB::$msexchange->disconnect());
    }
    
    // Quit the application
    WINDOW::$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 = "127.0.0.1:7012";
            InitXHE();
            // начало
            echo("<hr><font color=blue>msexchange->reply</font><hr>");
    
    
            /** Адрес API сервиса MS Exchange */
            string ms_api_url = "";
    
            /** Логин учётной записи Пользователя MS Exchange */
            string ms_api_email = "";
    
            /** Пароль учётной записи Пользователя MS Exchange */
            string ms_api_password = "";
    
            /** Домен учётной записи Пользователя */
            string ms_api_userDomain = "test";
    
            /** Запросить URL сервера EWS, если адрес не был указан явно (адрес неправильный).
             * Пример правильного URL EWS: https://outlook.office365.com/EWS/Exchange.asmx
             */
            bool useAutodiscoverEWSUrl = false;
    
            // 1
            echo("1. Соединится: ");
            echo(msexchange.connect(ms_api_url,  ms_api_email, ms_api_password, ms_api_userDomain, useAutodiscoverEWSUrl));
    
            // 2
            echo("\n2. Получить письмо по индексу 0-ое письмо из папки 'TEST_DOLENKO', чтобы получить ID письма: ");
            var mes = msexchange.get_message_by_number("TEST_DOLENKO", 0);
            if (mes != null) {
                echo(mes);
                // 3
                echo("\n3. Переслать письмо: ");
                echo(msexchange.reply("TEST_DOLENKO",  mes.message_id, "", "REPLY", 1, ms_api_email, "",null, false) + "\n");
            }
    
            // 4
            echo("\n4. Отсоединится: ");
            echo(msexchange.disconnect());
    
            // конец
            echo("\n");
    
            // Quit
            app.quit();
        }
    }
    xhe_host = "127.0.0.1:7010";
    
    // подключим функциональные объекты, если еще не подключен
    echo = require("../../../Templates JS/init.js");
    
    // начало
    echo("<hr><font color=blue>msexchange->reply</font><hr>");
    
    // доступы
    const {ms_api_url, ms_api_email, ms_api_password, ms_api_userDomain, useAutodiscoverEWSUrl} = require("./in/login.js");
    
    // 1
    echo("1. Соединится: ");
    echo(msexchange.connect(ms_api_url, ms_api_email, ms_api_password, ms_api_userDomain, useAutodiscoverEWSUrl));
    
    // 2
    echo("\n2. Получить письмо по индексу 0-ое письмо из папки 'TEST_DOLENKO', чтобы получить ID письма: ");
    mes = msexchange.get_message_by_number("TEST_DOLENKO",0);
    if (mes != null) {
    
        // 3
        echo("\n3. Переслать письмо: ");
        echo(msexchange.reply("TEST_DOLENKO", mes.message_id, "", "REPLY TEST", 1, ms_api_email, "", [], false ) + "\n");
    }
    
    
    // 3
    echo("\n3. Отсоединится: ");
    echo(msexchange.disconnect());
    
    // конец
    echo("\n");
    
    
    // Quit
    app.quit();

    =============================================
    msexchange        DOM  System  Vision  Web  Window        
    =============================================
    - ,
    .