Send Emails Using REST

a doctor's order is 0.125 mg of ampicillin 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 $REST.Email.send({ To: ["", ""], From: "", Subject: "Email Demo", Body: "This is an example of how to send an email using REST." }).execute();

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]'

Leave a Reply

Your email address will not be published. Required fields are marked *