通过 Java 禁用"mail forward"



我想禁用" email forward ";箴语法。请问是否可以通过MS图或者其他方式?

图API:message资源没有任何可以禁用邮件转发的属性,但应该可以在发送邮件时设置extended property

指定发送方是否允许消息自动转发的MAPI属性名称为PidTagAlternateRecipientAllowed。属性类型为"Boolean",id为"0x0002"。当PidTagAlternateRecipientAllowedtrue时,允许转发;当false时,不允许转发。

使用端点

发送邮件
POST https://graph.microsoft.com/v1.0/me/sendMail

与body

{
"message": {
"subject": "Test",
"body": {
"contentType": "Text",
"content": "testing"
},
"toRecipients": [
{
"emailAddress": {
"address": "john.doe@microsoft.com"
}
}
],
"singleValueExtendedProperties": [
{
"id": "Boolean 0x0002",
"value": "false"
}
]
}
}

读取check

的值
GET https://graph.microsoft.com/v1.0/me/messages/{message-id}$expand=singleValueExtendedProperties($filter=id+eq+'Boolean+0x0002')

资源:

消息资源

扩展属性PidTagAlternateRecipientAllowed

发送邮件

最新更新