PHP EWS排除带有特定主题前缀的电子邮件

PHP EWS排除带有特定主题前缀的电子邮件,php,exchangewebservices,Php,Exchangewebservices,我正在尝试获取尚未回复或转发的电子邮件列表(主题为RE:排除) 下面是获取带有特定主题前缀的电子邮件列表的代码。 我需要做什么来排除特定的主题前缀 $currentRestriction->Contains = new EWSType_ContainsExpressionType(); $currentRestriction->Contains->FieldURI = new EWSType_PathToUnindexedFieldType() $currentRestrict

我正在尝试获取尚未回复或转发的电子邮件列表(主题为RE:排除)

下面是获取带有特定主题前缀的电子邮件列表的代码。 我需要做什么来排除特定的主题前缀

$currentRestriction->Contains = new EWSType_ContainsExpressionType();
$currentRestriction->Contains->FieldURI = new EWSType_PathToUnindexedFieldType()
$currentRestriction->Contains->FieldURI->FieldURI = 'item:Subject';
$currentRestriction->Contains->Constant = new EWSType_ConstantValueType();
$currentRestriction->Contains->Constant->Value = 'test';
$currentRestriction->Contains->ContainmentComparison = new EWSType_ContainmentComparisonType();
$currentRestriction->Contains->ContainmentMode = new EWSType_ContainmentModeType();
&currentRestriction->Contains->ContainmentMode->_ = EWSType_ContainmentModeType::PREFIXED;
我已经弄明白了。 在上述代码前面添加以下两行将否定该语句

$currentRestriction->Not= new EWSType_NotType();
$currentRestriction = $currentRestriction->Not;

我只是快速浏览了一下您正在使用的搜索引擎——它看起来不支持“不带前缀”或类似的搜索类型(我可能很容易出错)。一种选择是检索所有电子邮件,并使用PHPThanks-Robbie筛选主题以“Re:”开头的邮件。是的,您是对的,EWS没有“未加前缀”的筛选器类型。我看到有一个搜索过滤器类型“Not”,并试图使条件类似于notcontain。但是,由于我不熟悉PHP和EWS,我正在努力获得正确的语法。