SharePoint Online提供程序主机发送电子邮件 - 拒绝访问

时间:2017-10-13 11:23:07

标签: email permissions sharepoint-online csom sharepoint-addin

我正在使用CSOM开发SharePoint提供商托管的加载项,并且我在使用以下方式发送电子邮件时拒绝访问:

EmailProperties emailProperties = new EmailProperties();
emailProperties.To = emailAddresses;
emailProperties.From = "no-reply@sharepointonline.com";
emailProperties.Body = @"XXXXX";
emailProperties.Subject = viagem.Title;

Utility.SendEmail(context, emailProperties);
context.ExecuteQuery();
  

[ServerUnauthorizedAccessException:拒绝访问。你没有   允许执行此操作或访问此资源。]
  Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(流   responseStream)+2911
  Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()+ 1564

该应用已经拥有一些权限:

<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
<AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="Read" />
<AppPermissionRequest Scope="http://sharepoint/bcs/connection" Right="Read" />

我有两个问题:

1-我需要添加哪些权限?

2-我试图使用&#34; no-reply@sharepointonline.com"作为发件人,因为工作流程中使用的地址是发件人。 任何人都知道SharePoint Online中电子邮件的默认电子邮件是什么?

谢谢

1 个答案:

答案 0 :(得分:0)

解决它。

1 - 网站集权限。

2 - 我可以使用&#34; no-reply@sharepointonline.com"