dpblwmh5218 2016-06-02 12:37
浏览 124
已采纳

php ews从收件箱复制邮件到其他用户的收件箱

With php-ews is there a possibility to copy a message from an inbox to other user's inbox?

The goal is that a message is created by php-ews in a web interface, saved to a shared inbox and after this save a copy of the message to user's inbox.

My code so far:

$id = $mail_items[$i]->ItemId->Id;
$change_key = $mail_items[$i]->ItemId->ChangeKey;

$request = new EWSType_CopyItemType();
$request->ToFolderId->FolderId->Id = $user_folder_id;
$request->ToFolderId->FolderId->ChangeKey = $user_folder_ckey;
$request->ItemIds->ItemId->Id = $id;
$request->ItemIds->ItemId->ChangeKey = $change_key;
$response = $ews->CopyItem($request);

The message does not appear in the other user's inbox. Thanks!

  • 写回答

1条回答 默认 最新

  • douzhan1963 2016-06-09 13:15
    关注

    Thanks to Gareth Parker, my error was found. I had forgotten to give always the exchange version in my clients.

    just specify the same Exchange version in every client you create:

    $ews = new ExchangeWebServices($host, $username, $password, ExchangeWebServices::VERSION_2007_SP1);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?