Sending Mails Using REST

The mail sending process is a POST method and so it uses a metadata content which is to be passed with different parameters as shown below.

The metadata includes the Sender’s and recipient’s email addresses along with the Subject and body of the mail.

function Mail(){
contentType: ‘application/json’,
url: “https://sitename/_api/SP.Utilities.Utility.SendEmail”,
type: “POST”,
data: JSON.stringify({
‘properties’: {
‘__metadata’: { ‘type’: ‘SP.Utilities.EmailProperties’ },
‘From’: ‘Sender’s email address’,
‘To’: { ‘results’: [‘recipient’s Email address’] },
‘Body’: ‘<h1>Hello!!</h1><p>This is mail was sent from a client side function</p>’,
‘Subject’:’Send eMail’
headers: {
“Accept”: “application/json;odata=verbose”,
“content-type”: “application/json;odata=verbose”,
“X-RequestDigest”: $(“#__REQUESTDIGEST”).val()
success: function (data) {
alert(“eMail sent successfully.”);
error: function (err) {



One thought on “Sending Mails Using REST

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s