sharepoint rest 脚本发送邮件

Posted 鳄鱼的眼泪

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sharepoint rest 脚本发送邮件相关的知识,希望对你有一定的参考价值。

function processSendEmails() { var from = ‘[email protected]‘, to = ‘[email protected]‘, body = ‘Hello World Body‘, subject = ‘Hello World Subject‘; // Call sendEmail function // sendEmail(from, to, body, subject); } function sendEmail(from, to, body, subject) { //Get the relative url of the site var siteurl = _spPageContextInfo.webServerRelativeUrl; var urlTemplate = siteurl + "/_api/SP.Utilities.Utility.SendEmail"; $.ajax({ contentType: ‘application/json‘, url: urlTemplate, type: "POST", data: JSON.stringify({ ‘properties‘: { ‘__metadata‘: { ‘type‘: ‘SP.Utilities.EmailProperties‘ }, ‘From‘: from, ‘To‘: { ‘results‘: [to] }, ‘Body‘: body, ‘Subject‘: subject } }), headers: { "Accept": "application/json;odata=verbose", "content-type": "application/json;odata=verbose", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val() }, success: function(data) { alert(‘Email Sent Successfully‘); }, error: function(err) { alert(‘Error in sending Email: ‘ + JSON.stringify(err)); } }); } $(document).ready(function () { SP.SOD.executeFunc(‘sp.js‘, ‘SP.ClientContext‘, processSendEmails); });

以上是关于sharepoint rest 脚本发送邮件的主要内容,如果未能解决你的问题,请参考以下文章

通过 php 脚本定期发送电子邮件

linux利用网易邮箱发送邮件

转:SharePoint2013TimerJob计时器发送邮件

sharepoint 2013/2016 共享给新用户时,默认不选中 发送电子邮件邀请

powershell 监控SharePoint,本地服务器和SQL服务,页面并向某人发送报告电子邮件。

如何停止Sharepoint发送已完成和已删除任务的任务逾期电子邮件