web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send http request to S...
Power Automate
Unanswered

Send http request to SharePoint Action - Email does not include external "To" recipients

(1) ShareShare
ReportReport
Posted on by 195

I recently faced a problem when trying to send a no-reply mail via "Send an HTTP request to SharePoint". The mail is sent correctly, but not all my "To" recipients are included in the mail, that is, the external email addresses are skipped. 

Please note that using the action "Send http request to SharePoint" is required. As no official email Id is to be used for correspondence.

I use the following JSON:

 

 

{
"properties":
{"__metadata": {"type":"SP.Utilities.EmailProperties"},
"From":"",
"To": {"results":["douglas@external.com","peet@fashion.tv"]},
"CC": {"results":["john@contoso.onmicrosoft.com","info@contoso.onmicrosoft.com"]},
"Body":"Test Body",
"Subject":"Hello World"
}
}

 

 


Does anybody have a solution for this?

Thanks in advance!

@ManishSolanki @creativeopinion @Pstork1 @Chriddle @Expiscornovus @tom_riha @trice602 @Nived_Nambiar @ekarim2020 @Tomac @AlexEncodian @schmid1208 @abm @Paulie78 @lbendlin @Flashheart @Rhiassuring @David_MA @SudeepGhatakNZ @rzaneti @ChrisPiasecki 

Categories:
I have the same question (0)
  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    Hi @akg1421 

     

    Could you perform a test with one external email hardcoded in the To field (no variables) and nothing in the CC field?

  • asmit782 Profile Picture
    23 on at

    I had an issue similar to this where the people/email address not getting the emails did not have the correct permission with the SharePoint site. 

  • sandeepstw Profile Picture
    312 Moderator on at

    Hi  , 

    Register an application in Azure Active Directory (AD) to obtain the necessary permissions for sending emails via Microsoft Graph API. Make sure to grant the application the required permissions to send emails. Use the client credentials flow or another suitable authentication method to obtain an access token for your Azure AD application.

     

    https://learn.microsoft.com/en-us/azure/active-directory-b2c/microsoft-graph-get-started?tabs=app-reg-ga

     

    Use the access token to make a POST request to the Microsoft Graph API endpoint for sending emails. You can use the /users/{userId}/sendMail endpoint to send emails on behalf of a user. In the request body, specify the recipient email addresses (including external addresses), subject, body, and any other necessary email properties.

     

    Here is python code for this -

     

    import requests

    import json

     

    # Azure AD App Registration details

    client_id = 'your_client_id'

    client_secret = 'your_client_secret'

    tenant_id = 'your_tenant_id'

     

    # Microsoft Graph API endpoint

    graph_url = 'https://graph.microsoft.com/v1.0'

     

    # Authentication

    token_url = f'https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token'

    token_data = {

        'client_id': client_id,

        'client_secret': client_secret,

        'scope': 'https://graph.microsoft.com/.default',

        'grant_type': 'client_credentials'

    }

    token_response = requests.post(token_url, data=token_data).json()

    access_token = token_response['access_token']

     

    # Email properties

    email_properties = {

        "message": {

            "subject": "Hello World",

            "body": {

                "contentType": "Text",

                "content": "Test Body"

            },

            "toRecipients": [

                {"emailAddress": {"address": "douglas@external.com"}},

                {"emailAddress": {"address": "peet@fashion.tv"}}

            ]

        }

    }

     

    # Send email via Microsoft Graph API

    send_mail_url = f'{graph_url}/users/{sender_email}/sendMail'

    headers = {

        'Authorization': 'Bearer ' + access_token,

        'Content-Type': 'application/json'

    }

    response = requests.post(send_mail_url, headers=headers, json=email_properties)

     

    if response.status_code == 202:

        print("Email sent successfully!")

    else:

        print("Failed to send email:", response.text)

     

    Mark as solution if it helps. 

     

    Thanks,

    Sandeep Mishra

    @akg1421

  • amk1421 Profile Picture
    195 on at

    @DJ_Jamba Didn't work! To field and CC field does not matter if we hardcode email one property or both.

  • amk1421 Profile Picture
    195 on at

    @asmit782 External users (non-organizational) don't require permissions to SharePoint site.

  • tmiller888 Profile Picture
    16 on at

    I don't know if there's a way to send to external users with the "Send an HTTP request to SharePoint" action, but I've had to use the "Send an email notification (V3)" action on sites with external users (users whose email address is not in Azure AD).  The sender of the emails ends up being "Microsoft Power Apps and Power Automate" which is not ideal, but the emails work.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard