我确实收到了各种机器人发送的大量邮件。我可以通过主题轻松识别电子邮件(例如:"对票证123和#34的响应;)。 不幸的是,每封电子邮件都是自动生成的
对于此Outlook,不将它们分组为普通会话。
我想知道是否可以修改例如mail属性" ConversationID"?我是否需要创建一个" ConversationTopic"并将其分配给相关的MailItems?
答案 0 :(得分:3)
我能够通过使用Redemption来获取对ConversationTopic和ConversationIndex的MAPI属性的写访问权来解决这个问题。
虽然ConversationTopic最初用于分组消息,但ConversationIndex也在分组中起作用:它不仅带有排序时间戳,而且第一个字节是必须在对话的所有电子邮件中匹配的对话代码。否则它们仍然没有分组,即使是相同的主题。有关详细信息,请参阅此处:https://msdn.microsoft.com/en-us/library/ms528174(v=exchg.10).aspx
幸运的是,将Index设置为Null显然会使Outlook仅关注该主题,因此我们无需重新计算新索引。
我的工作代码:
<?php
$servername = "******";
$username = "******";
$password = "******";
$dbname = "******";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "select id ,Title , Description , Venue , Date from lodhievent";
$result = $conn->query($sql);
$values = array();
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$values['data'][] = array(
'id'=>$row['id'],
'Title'=>$row['Title'],
'Description'=>$row['Description']
'Venue'=>$row['Venue']
'Date'=>$row['Date']
);
}
header('Content-Type: application/json;charset=utf-8');
echo json_encode($values ,JSON_PRETTY_PRINT);
} else {
$values = array(
'error'=>'No results found'
);
}
$conn->close();
?>
答案 1 :(得分:1)
这不是一个完整的答案,但是评论太长了。
我可以使用提示here和代码设置MAPI conversationTopic和conversationIndex属性:
oItem.propertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/proptag/0x00710102", _
oItem2.propertyAccessor.GetProperty("http://www.slipstick.com/developer/read-mapi-properties-exposed-outlooks-object-model/")
例如,对于ConversationIndex属性,。这假定您有一条消息作为oItem而另一条消息作为oItem2,两者都声明为对象。请注意,此属性是二进制的,因此如果要查看它,可以使用:
oItem2.propertyAccessor.BinaryToString(x)
其中x表示属性(设置为变量或只是将propertyAccessor.GetProperty代码放在那里)。这变得相关,因为消息对象的ConversationID是MAPI ConversationIndex属性的最后一串“字符/二进制位”。但是,更改ConversationIndex属性DID不会更改ConversationID。
消息对象的ConversationIndex和conversationTopic属性都是只读的,但是更改conversationTopic MAPI属性DID会更改消息的ConversationTopic属性。但是,我无法将其实际分组。
我的研究表明,ConversationTopic属性应该是最初对消息进行分组的属性,ConversationIndex属性在分组后对它们进行排序,但正如我所提到的,即使在分配之后,我也无法将消息分组。与MAPI和消息对象相同的ConversationTopic。
这是帮助显示此行为的代码:
Dim Msg As Outlook.MailItem
Dim oItem As Object
Dim oItem2 As Object
Dim objNS As Outlook.NameSpace
Dim olFolder As Outlook.MAPIFolder
Dim Item As Object
Set objNS = GetNamespace("MAPI")
Set olFolder = objNS.GetDefaultFolder(olFolderInbox)
For Each Item In olFolder.Items
If TypeName(Item) = "MailItem" Then
Debug.Print "Subject: " & Item.Subject & " " & Item.propertyAccessor.BinaryToString(Item.propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x00710102"))
If Item.Subject = "test" Then
Set oItem = Item
ElseIf Item.Subject = "test2" Then
Set oItem2 = Item
End If
End If
Next Item
Debug.Print "OItem: " & vbCr _
& "ConversationIndex: " & oItem.ConversationIndex & vbCr _
& "ConversationID: " & oItem.ConversationID & vbCr _
& "ConversationTopic: " & oItem.ConversationTopic & vbCr _
& "MAPI ConversationIndex: " & oItem.propertyAccessor.BinaryToString(oItem.propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x00710102")) & vbCr _
& "MAPI ConversationTopic: " & oItem.propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0070001E") & vbCr
Debug.Print "OItem2: " & vbCr _
& "ConversationIndex: " & oItem2.ConversationIndex & vbCr _
& "ConversationID: " & oItem2.ConversationID & vbCr _
& "ConversationTopic: " & oItem2.ConversationTopic & vbCr _
& "MAPI ConversationIndex: " & oItem2.propertyAccessor.BinaryToString(oItem2.propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x00710102")) & vbCr _
& "MAPI ConversationTopic: " & oItem2.propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0070001E") & vbCr
Debug.Print "Set OItem2 To OItem"
oItem2.propertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/proptag/0x0070001E", oItem.ConversationTopic
oItem2.propertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/proptag/0x00710102", oItem.propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x00710102")
Debug.Print "OItem: " & vbCr _
& "ConversationIndex: " & oItem.ConversationIndex & vbCr _
& "ConversationID: " & oItem.ConversationID & vbCr _
& "ConversationTopic: " & oItem.ConversationTopic & vbCr _
& "MAPI ConversationIndex: " & oItem.propertyAccessor.BinaryToString(oItem.propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x00710102")) & vbCr _
& "MAPI ConversationTopic: " & oItem.propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0070001E") & vbCr
Debug.Print "OItem2: " & vbCr _
& "ConversationIndex: " & oItem2.ConversationIndex & vbCr _
& "ConversationID: " & oItem2.ConversationID & vbCr _
& "ConversationTopic: " & oItem2.ConversationTopic & vbCr _
& "MAPI ConversationIndex: " & oItem2.propertyAccessor.BinaryToString(oItem2.propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x00710102")) & vbCr _
& "MAPI ConversationTopic: " & oItem2.propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0070001E") & vbCr
分享此内容以防止任何人解决问题。