【发布时间】:2019-12-10 19:36:20
【问题描述】:
为了将电子邮件组织成单线程,GMail 需要在传入消息中设置自定义标题。通过 Graph API 发送 Office O365 Outlook 消息时,有什么方法可以设置自定义标头?文档通过 InternetMessageHeaders 属性说明了自定义标头选项,但是需要以“x-”附录开头的标头名称,这使得它不可用。例如,这条消息应该设置一些自定义标题,但是,由于 'x-' 前缀限制,这不能用于组织 GMail 消息:
POST https://graph.microsoft.com/v1.0/me/sendMail
Content-type: application/json
{
"message": {
"subject": "9/9/2018: concert",
"body": {
"contentType": "HTML",
"content": "The group represents Nevada."
},
"toRecipients": [
{
"emailAddress": {
"address": "AlexW@contoso.OnMicrosoft.com"
}
}
],
"internetMessageHeaders":[
{
"name":"x-custom-header-group-name",
"value":"Nevada"
},
{
"name":"x-custom-header-group-id",
"value":"NV001"
}
]
}
}
https://docs.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0&tabs=http
有没有办法指定自定义标题:'References'、'In-Reply-To' 没有前缀'x-'? https://gsuiteupdates.googleblog.com/2019/03/threading-changes-in-gmail-conversation-view.html
尝试设置不带“x-”前缀的自定义电子邮件标头时,Graph API 返回以下错误消息:
{
"error": {
"code": "InvalidInternetMessageHeader",
"message": "The internet message header name 'References' should start with 'x-' or 'X-'.",
"innerError": {
"request-id": "441e21b7-d4ca-47d3-957a-a72bcc854a67",
"date": "2019-12-10T14:28:35"
}
}
}
【问题讨论】:
标签: outlook office365 microsoft-graph-api outlook-restapi microsoft-graph-mail