Home > CMS- Content Management System > Sharepoint > How to send an email using REST API in SharePoint?

How to send an email using REST API in SharePoint?

This post was most recently updated on July 31st, 2024

In SharePoint Online we have used the Workflow to send an email notification to the user/group, but in some cases, we don’t want to create a workflow just for email.

For more info about the email trigger using workflow click HERE.

In this article, I will share how can we send emails using REST API (SP.Utilities.Utility.SendEmail).

Here are the keynotes and observations of send email method

  1. The recipients should be valid SharePoint Users. Mails cannot be sent to non-SharePoint users and external users. Any email accounts that have not been authenticated to SharePoint will throw an error.
  2. We cannot add an attachment with this API call, but we can add an inline attachment, I have tested with the image which is hosted on same email SharePoint domain. External domain image can be work if we change image to base64 and attach that.
  3. The SP.Utilities.Utility.SendEmail does not support to send emails to the Distribution group/list users.
  4. There is a limitation of the max size of email content.
  5. The format of your “To” variable must be an Array which contains emails (or domain\login) like var recipients = [“a@b.com”,”b@b.com”];
  6. It uses SP.Utilities.Utility.SendEmail
  7. You can use HTML tag [a,p,div etc.] in the email body, in case it does not work add Additional Headers
  8. Make sure to include the required jQuery references
  9. By default SharePoint use Site Title as an email header, to change the “From” headers in email, navigate to the Site Settings -> Look and Feel -> Look and Feel -> Title, description, and logo

Additional headers for the email

Here is the output:

Send Mail Through REST API

Hope you find it helpful. If you liked this article, then please share and comment. Your comment and suggestion will be greatly appreciated.

This Article is TAGGED in , , , , , , . BOOKMARK THE permalink.

Avatar photo
Chintan Upadhayay
I am a senior web developer with more than 4+ years experience in WordPress, PHP, MySQL, HTML, CSS, jQuery and other web technologies. I am the beginner in SharePoint and Learning SharePoint.

2 thoughts on “How to send an email using REST API in SharePoint?

  1. Dear Chintan Upadhayay,

    I know its been almost a year, but in the article you mention that we can add inline attachments to the email. Can you explain it in more details please? I try to send and email with inline images, but not sure how to do it.

    Thanks in advance,
    Daniel

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">