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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get original sender bo...
Power Automate
Unanswered

Get original sender body from forwarded emails

(0) ShareShare
ReportReport
Posted on by 24

Hi,
I am creating a flow where the trigger is "When an email arrives".I normally get emails  forwarded to me that have been forwarded to many other people before it comes to me.  I want to be able to automatically capture the info from the  original sender Mail Id and Body. is this possible to do?, Please Advice

Categories:
I have the same question (0)
  • alaabitar Profile Picture
    1,503 Super User 2024 Season 1 on at

    Hey @satheeshreddy 

     

    Maybe this info is in the headers of the email. You can get the hole output from the trigger email receive by for example assigning to a variable the triggerOutputs() expression. 

    Like 

    alaabitar_0-1678259889499.png

    From there you probably need to analyse the headers received by doing something like 

    triggerOutputs()?['headers']
     
  • VictorIvanidze Profile Picture
    13,079 on at

    You cannot.

  • Gurneet Profile Picture
    2 on at

    Hello @satheeshreddy , 
    yes you can, i recently did this in one of my flows
    Sharing an example of flow steps :


    1. Create an automated flow with trigger on Email message activity and you can have fileter such as torecepients and subject of that email so that it doesnt run for all email activities.

    Gurneet_0-1709577862902.png

     

    2. Search for HTML to Text action and Add it,  then pass Description - dynamic field from Trigger this the email body in this action

    Gurneet_3-1709578076940.png

     

     

    Gurneet_1-1709578018410.png

     

    3. Now you need to add variables , with expression as :

    Gurneet_0-1709580277267.png

     


    considering this is your email:

    Hi,
    please find below the forwarded email.

     

    thanks

     

    From: Original Sender <original.sender@example.com>

    Sent: Tuesday, February 20, 2024 5:09 AM

    To: Test receiver <test@example.com>

    Subject: Query to get sender email from forwarded email


    my variable expressions are : 

    trim(first(split(last(split(outputs('Html_to_text')?['body'], 'From:')), 'Sent')))
    which will capture : Original Sender <original.sender@example.com>
    now you can further trim or customize the text captured , or use as per needs, which i do in the second var in the above screenshot:
    if(and(contains(variables('original sender'),'<'),contains(variables('original sender'),'<'),contains(variables('original sender'),'.com'),contains(variables('original sender'),'@')),trim(first(split(last(split(variables('original sender'), '<')), '>'))),null)

    this will get  : original.sender@example.com
     
     
     
    Hope this helps.
     
     
    thanks
    Gurneet

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 173 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 95 Super User 2026 Season 1

Last 30 days Overall leaderboard