问题描述
我一直想弄清楚如何做到这一点。我看了一堆例子,但我似乎遇到了它的URL方面的问题,似乎我没有访问权限使用SP.Utilities.Utility.SendEmail或它不存在。
I've been trying to figure out how to do this. I've looked at a bunch of example but i seem to run into an issue with the URL aspect of it where it seems like I don't have access to use SP.Utilities.Utility.SendEmail or it doesn't exist.
我可以使用Utility但不低于该值。
I can get down to Utility but nothing below that.
我的网站网址如https:// mysite / sites / byteback / gameshow /
My site URL is like https://mysite/sites/byteback/gameshow/
添加_api / stuff似乎是个问题。如果我深入研究错误,我会得到这个:
adding the _api/ stuff seems to be the issue. If I dig down into the error I get this:
" {" error":{" code":" -2130575251,Microsoft.SharePoint.SPException"," message":{" lang":" en-US" ;,"value":"此页面的
安全验证无效,可能已损坏。请使用网络浏览器的"返回"按钮再次尝试操作。"}}}"
我缺少什么或者我需要在我的网站上启用还是收集才能使用它?
What am I missing or is there something I need to enable on my site or collection in order to use this?
推荐答案
错误讯息可能是因为您的请求中缺少重要的标头,即代码中的X-RequestDigest标头。
The error message may be caused by missing an important header in your request which is the X-RequestDigest header in your code.
请查看以下链接了解详情:
Please check the link below for more details:
要使用REST API发送电子邮件,请请参阅以下链接中的代码演示:
To send email using REST API, please refer to the code demo in the link below:
https://codeplayandlearn.wordpress.com/2015/07/11/send-email-through-rest-api-in-sharepoint/
谢谢,
Victoria
这篇关于通过javascript发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!