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 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号