Skip to content

Instantly share code, notes, and snippets.

Created February 1, 2017 20:02
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
SpFxFlowEmailWebPart sendEmailViaOffice365Outlook method
private sendEmailViaOffice365Outlook(emailaddress: string, emailSubject: string, emailBody: string): Promise<HttpClientResponse> {
const postURL =;
const body: string = JSON.stringify({
'emailaddress': emailaddress,
'emailSubject': emailSubject,
'emailBody': emailBody,
const requestHeaders: Headers = new Headers();
requestHeaders.append('Content-type', 'application/json');
const httpClientOptions: IHttpClientOptions = {
body: body,
headers: requestHeaders
console.log("Sending Email");
.then((response: Response): Promise<HttpClientResponse> => {
console.log("Email sent.");
return response.json();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment