zoukankan      html  css  js  c++  java
  • sharepoint rest 脚本发送邮件

    function processSendEmails() { var from = 'asad@Example.com', to = 'someone@Example.com', 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); });

  • 相关阅读:
    局域网 标准
    协议的构成
    耦合
    theano中tensor的构造方法
    Mac下安装OpenCV3.0和Anaconda和环境变量设置
    【数据源】24万数据集:社会发展类公开数据清单
    Windows Thin PC(7月2日发布)下载+激活+汉化
    CNN笔记
    Python 爬虫的工具列表
    test image
  • 原文地址:https://www.cnblogs.com/olay/p/7851571.html
Copyright © 2011-2022 走看看