Note: This posting is not intended to be a tutorial on how to send email through REST on SharePoint but rather document the attempts to override the Reply-To within the REST service to prove that some headers cannot be added or overridden.

Within SharePoint Online email can be sent out to internal users using JavaScript to communicate with the built in REST services. One minor downside is that the email will come from a SharePoint no-reply address and not the email address you specified from. What I have found out is that there is a setting to apply additional headers to the email that most others have not worked with, and there is little documentation on it. Unfortunately, to save others the time: it is not possible to configure the reply-to path. Below is a picture describing the internal email properties object and what there is to work with:

emailprops

You’ll notice the lack of Reply-To. The From just makes the users display name appear next to the SharePoint no-reply email address. However the additional headers was tested to see if I could over-ride them. In my code I configured the object to be added to the REST call and tried overriding the Reply-To as well as Return-Path, including a Return-Pathg as an intended typo just to see if SharePoint would allow something (that wouldn’t be forced due to it being a non-standard header).

headers-test

Then after sending it off, making sure the browser sent it as part of the REST payload:

restAfter this email was sent out, I inspected the headers to see if any of these were applied to the email headers:

source

Note the Reply-To and the Return-Path, the header additions do NOT override what SharePoint assigns them (the no-reply@sharepointonline.com address). However, other headers are definitely possible to add, as we see that the Return-Pathg intended typo header came through.

 

No Comments

There are no comments related to this article.

Leave a Reply

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