【发布时间】:2019-03-04 11:16:56
【问题描述】:
由于某种原因,“代表发送”功能对我来说失败了。图表始终返回 ErrorSendAsDenied(当 From 和 Sender 字段值不同时)。
验证帐户具有正确的配置以代表彼此发送。在花了三天多的时间后,我无法让它工作。
在身份验证期间请求以下权限:
openidemailprofileoffline_access-
User.Read -
Mail.Read Mail.ReadWriteMail.Read.SharedMail.ReadWrite.SharedMail.SendMail.Send.Shared
对于下面的示例,用户 Gregory Test 希望代表 Sem Test 发送消息。有效的授权访问令牌(由 Gregory Test 验证)用于发送电子邮件,但电子邮件传递总是失败。
提交的 JSON 消息示例为:
{
"Message":{
"Subject":"Trying to send message on behalf",
"Body":{
"ContentType":"html",
"Content":" email html content "
},
"From":{
"EmailAddress":{
"Address":"sem.test@contoso.com",
"Name":"Sem Test"
}
},
"Sender":{
"EmailAddress":{
"Address":"gregory.test@contoso.com",
"Name":"Gregory Test"
}
},
"ToRecipients":[
{
"EmailAddress":{
"Address":"semtestestestes@gmail.com",
"Name":"Sem Shehovtsov"
}
}
]
}
}
如果Sender 和From 设置为相同的值,则工作正常。 Sender 邮箱配置为允许代表其他用户发送邮件。
有什么想法吗?
【问题讨论】:
标签: microsoft-graph-api microsoft-graph-mail