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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to send Email usin...
Power Pages
Unanswered

How to send Email using Web API in PowerApps Portal

(1) ShareShare
ReportReport
Posted on by 175

Hello 

Can I send email in background by passing parameters like receiver email id , subject , body text using below method

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/sendemail?view=dynamics-ce-odata-9

Categories:
  • H V Profile Picture
    1,510 on at

    Hi @Dhananjay_Patil 

    As I understand, you want to send an email from PowerApps Portal. 

    The link which you have provided is for Dynamics 365, not for PowerApps Portal.

     

    Can you explain your requirement in details? So, some one can help you.

    Like, you want to send an email on create of record or on click of custom button, etc.

  • Dhananjay_Patil Profile Picture
    175 on at

    Hi @hardikv 

    Yes I want to send email in background from PowerApps Portal

    My Details Requirement is as below

    1. If user A added  some records from portal  then I want to send email to Users X and User Y
    2. If user B added some records from portal then I want to send email to User P and User Q

    So I am looking for such solution that I will pass parameters to any function/Web API like receiver email, subject , email body and mail will be send to that users in background

  • Dhananjay_Patil Profile Picture
    175 on at

    Hello @hardikv 

    Can I reference bellow link for adding record in Email entity using web API and Create action

    While calling API all parameters will be send like 'to', 'from', 'subject' , 'message'

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/reference/entities/email

    Screen Shot 2563-07-31 at 11.33.42.png
  • H V Profile Picture
    1,510 on at

    Hi @Dhananjay_Patil 

     

    You can achieve your requirement using Http Trigger method PowerAutomate.

    Please refer below blogs to create Power Automate: https://medium.com/@zaab_it/microsoft-flow-send-email-from-http-request-f6577ad46b2c

     

    After creation of power automate, you will get HTTP POST URL. Then you can add that url in httpTriggerUrl variable in below code.

    function sendEmail(){
     var objEmail = {};
    
     objEmail.subject = "This is subject";
     objEmail.to = "receiver@outlook.com";
     objEmail.body = "This is body";
    
     var stringJSON = JSON.stringify(objEmail);
    
     var httpTriggerUrl = "https://prod-29.westus.logic.azure.com:443/workflows/5192b9bc428746ec93b21e6c8f9d0fe7/triggers/manual/path";
    	
     $.ajax({
     type: "POST",
     contentType: "application/json; charset=utf-8",
     datatype: "json",
     url: httpTriggerUrl,
     data: stringJSON,
     async: true,
     beforeSend: function (XmlHttpRequest) {
     XmlHttpRequest.setRequestHeader("Accept", "application/json");
     XmlHttpRequest.setRequestHeader("Content-Type", "application/json; charset=utf-8");
     XmlHttpRequest.setRequestHeader("OData-MaxVersion", "4.0");
     XmlHttpRequest.setRequestHeader("OData-Version", "4.0");
     },
     success: function (data, textStatus, XmlHttpRequest) {
     alert("success");
     },
     error: function (xmlHttpRequest, textStatus, errorThrown) {
     alert(xmlHttpRequest.responseJSON.error.message);
     }
     });
    }

     

    You have to add this code in Page's localized content. You also have to add button in your web page.

    <button onclick="sendEmail();">Send Email</button>

     

    --------------------------
    If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
M Bilal Khan Profile Picture

M Bilal Khan 99

#2
Mohsin Ali Profile Picture

Mohsin Ali 37

#3
11manish Profile Picture

11manish 21 Super User 2026 Season 2

Last 30 days Overall leaderboard