【问题标题】:Garethp/php-ews: access two different mailboxes associated to the same MS exchange userGarethp/php-ews:访问与同一个 MS 交换用户关联的两个不同邮箱
【发布时间】:2020-03-28 15:36:51
【问题描述】:

库: Garethp/php-ews

MS Exchange 版本: 2016

我在同一个登录名下有两个邮箱。

mail1@example.com

mail2@example.com

授权:

$ews = API::fromUsernameAndPassword('example.com', 'mail1@example.com', 'some_pass');

我可以从mail1 访问所有文件夹,但不知道如何访问mail2 内容。

有什么方法可以访问与同一个 MS Exchange 用户关联的这两个不同邮箱?

在 GitHub 上有类似的问题,但不同的库 (jamesiarmes/php-ews):https://github.com/jamesiarmes/php-ews/issues/404

有什么想法吗?

【问题讨论】:

    标签: php php-ews


    【解决方案1】:

    有一个方法setPrimarySmtpEmailAddress。因此,在登录到电子邮件帐户后,立即设置您要访问的电子邮件地址:

    $ews = API::fromUsernameAndPassword(
    'example.com', 
    'mail1@example.com', 
    'some_pass'
    )->setPrimarySmtpEmailAddress('mail2@example.com')->getMailbox();
    

    差不多就是这样。其他操作保持不变:获取文件夹、阅读电子邮件等。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-06
      • 2010-12-09
      • 2021-12-14
      • 1970-01-01
      • 2020-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多