title: sending an email through sharepoint REST api in javascript
body: <p>I have been trying to send an email to the sharepoint user on click of a button in a client side web page.</p>
  
  <p>I am trying to use the REST API using JSOM
  and the code looks like below.</p>
  
  <pre><code>sendEmail("user@domain.com", "rec@domain.com", "test", "test-email");
  function sendEmail(from, to, body, subject) {
  
  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": $("#__REQUESTDIGEST").val()
      },
      success: function (data) {
         alert("Eposten ble sendt");
      },
      error: function (err) {
          alert(err.responseText);
          debugger;
      }
  });
  }
  </code></pre>
  
  <p>The issue what am facing here is:
  1. Am getting an error 404 Not Found => does it mean my server does not have the utilities api?
  2. When i tried (siteurl + "/_api/SP.Utilities.Utility.SendEmail") in browser it gives 404 not found.</p>
  
  <p>Let me know how to resolve this issue.(Note: i dont have access to central admin).
  (or)
  Is there any other way to send an email without using workflow? or to call an workflow from a script?</p>