Send Emails Using REST

In this post, I’ll demonstrate how to send an email in a SharePoint 2013 (On-Premise) or Online environment. This will be using the REST library I created, which is available on npm and github.

// Send the email
    To: ["", ""],
    From: "",
    Subject: "Email Demo",
    Body: "This is an example of how to send an email using REST."

Note - The library will automatically set the metadata type to “SP.Utilities.EmailProperties”. Note - The “To” property can be a string or array of strings. The library will convert it appropriately.

The above will send an email against the following url:

https://[SP Web Url]/_api/SP.Utilities.Utility.SendEmail

For those not wanting to use the library, the body of the request should be in the following format:

    'properties': {
        '__metadata': { 'type': 'SP.Utilities.EmailProperties' },
        'From': '',
        'To': { 'results': ['', ''] },
        'Subject': '[Subject of Email]',
        'Body': '[Body of Email]'