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 Automate / Sending Email to the c...
Power Automate
Unanswered

Sending Email to the client by Using the @Domain instead the Physical Email address

(0) ShareShare
ReportReport
Posted on by Super User 2024 Season 1

Hi Nived,

I have a question.  I know we create the script based on the 'Sender email address' but not as the 'Domain Address'.

Let say for instance, I did receive an email from helpdesk@rlcarriers.com, and them someone else from the same company try to send me a attachment next month and I will missed it.  Let me explain, if I put all the people, I think on the same company within the email list you make me create. If one of them sent me an attachment, it will send the other people I did not receive it.  Which is true.  Instead checking it by the sender email address, can use the 'Domain Email' instead?  Meaning if anyone from '@RLCarriers.com' sent me an attachment it won't send a second request to the other clients in the same company.  If no one from the @RLCarriers.com not sending email at all or sent an email with no attachment, then the script can send a second request to all the clients. Please let me know if this is a quick fixed.  Because I need to cover all the possibility that they might be someone else send me a attachment file.  Please let me know if I don't make any sense I will explain with more detail when we meet.  Please let me know day and time that is good for you.  Thanks again!

PS. I JUST THOUGHT OF SOMETHING.  HOW THE SCRIPT WILL KNOW TO SEND A SECOND REQUEST TO ALL CLIENTS THAT DID NOT SEND AN EMAIL OR SEND AN EMAIL WITH NO ATTACHMENT?  BECAUSE IF THERE'S NO PHYSICAL EMAIL ADDRESS, IT JUST THE 'DOMAIN EMAIL'. HMM!!!   MAYBE MY APPROACH WON'T WORK.  Please let me know what you think.  Otherwise, I don't want to be slave the client list to keep modify it when a new person sending me the file.

 

mhixon@rlcarriers.com;matt.kohn@rlcarriers.com;helpdesk@rlcarriers.com;

 

TTC_0-1694434806903.png

 

 

I am trying to do it as a 'Domain', but because I did not receive an email by this client then the script it breaks. It should send second request to the clients for those either have not sent an email or send an email with no attachment.

TTC_4-1694435993689.png

 

 

TTC_3-1694435014950.png

 

 

 

 

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    I am not sure I understand you properly here. It seems like you posted this as a new topic, while it was intended to be a reply to an ongoing conversation with @Nived_Nambiar .

     

    Anyway, you cannot really filter by domain in the retrieve emails actions in PAD. But you can then retrieve all emails unread emails with no sender filter. Then you can loop through each email and check the sender. If the domain is what you need, you process it. Otherwise, you set the email as unread again (so that you don't interfere with other messages) and skip it.

     

    Simply get the %CurrentEmail.From% and use Replace text to replace the start of the email address up to the @ sign by using regular expressions. Use this regex to accomplish this: .*@

     

    You can then compare the output with the domain that is relevant for you.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • TTC Profile Picture
    Super User 2024 Season 1 on at

    The problem is I already receive an email attachment from that company (helpdesk@rlcarriers.com) The script should not send another request from the other two clients in the same company.  My question, the script should  be checking the email domain or something else. Because if I already received an email from either these people in the same company.  In that case, yes  I am and it should skip both mhixon and matt.kohn email addresses.

     

    TTC_0-1695239671073.png

    I did received the client email below along with the attachment.  Sometimes, I might  receive from other folks.  Again, regardless who sent it to me, the script should not send another request from the other clients.

     

    TTC_1-1695239843452.png

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Is there some sort of a timeframe for which you would like to stop sending further emails to the same domain? Or do you just want to never do it again after it's been done once? You will need to store the fact you have already received an email from that domain in some sort of a database for future reference in order to be able to decide if you should send it again or not. That would probably be easiest to implement, but the exact details of the solution depend on the specific requirements.

  • TTC Profile Picture
    Super User 2024 Season 1 on at

    Let me see if I can make this as easier enough.  We have 3 categories.

    1. Received client email with attachment file

    2. Receive client email, but with no attachment

    3. Receive NO email from the client

    So, If I received an email with the attachment from ANY CLIENT WITHIN THE SAME COMPANY, the script should go to next company.  (so currently this is how the script run:  if I have 3 clients in the same company, the script will read only the client's email that send me the attachment and send a request from the other 2 clients that we did not receive your email).  For me this is wrong.  I already receive an email with attachment from @RLCarriers.com (it doesn't matter who sent it to me)

    So, the next two scenarios step 2 and 3 will DEFINITELY send another request to clients that we did not receive your attached file.  I hope this is clear.  This is a monthly report and need to repeat each month.

    ***If all the clients send their email WITH ATTACHED FILE, then no second request should be sent to anyone regardless who send it to me. 

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Okay. So, I guess what you need is a database where you can store a value (simply True or 1 or whatever) for a given month/domain combination. You can use a SharePoint list for that, or a SQL database or whatever you like.

     

    So, whenever a user from a specific domain sends you an email, you first check if your database already has an entry for the current month + domain combination. If it does, you ignore the email, regardless of whether it has an attachment, or not.

     

    If it doesn't, then you check if the current email has an attachment. If it does, then you update the database by inserting a line for the current month + domain. This will then make it so that further emails get ignored by the first rule.

     

    If it's not in the database yet, and the email does not contain an attachment, you do not insert anything to the database, but reply to the email (or send it to whoever you should send it to) to get the attachment.

     

    And then you also have a separate scheduled flow at the end of the month to check all domains, see if any of them is missing an entry in the database for the current month, and send a reminder to the appropriate person, if they are.

     

    Does that make sense to you?

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @TTC 

     

    Sorry for late response,

     

    As for your requirement, currently it is not possible via outlook actions Retreive email message as parameter from expects full email address to be added instead of partial one . 

    So If it is possible for you you can try using the Outlook 365 actions which can help to filter the sender by its domain , something like below

     

    Nived_Nambiar_0-1696052696259.png

     

    One query on your approach of using multiple same clients emails on same cell seperated by comma like a@abc.com , b@abc.com , does it create a problem when no emails or attachments are found for all the emails mentioned in single cell , does flow would send emails to all person for reminder ?

    would you need like that ?

     

     

     

  • TTC Profile Picture
    Super User 2024 Season 1 on at

    Hi Nived,

    Yes, if I bring all the emails on one single cell and separate by a comma, the script is failed on line #42.

     

    TTC_0-1696077462712.png

    Also, I don't have this function on my PAD.  It's disable on my side.

     

    TTC_1-1696077645123.png

    II-

    When I try to separate the emails by semi-colon instead with comma, it sends everyone an email and it did not retrieve the attachment from the email for RLCarriers.com.  But I did receive the attachment from helpdesk@rlcarriers.com

     

    TTC_2-1696078381837.png

     

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @TTC 

     

    Reason would be simple, Take this example:

     

    we have a set of email ids a@abc.com; b@abc.com   seperated by semicolon. Now if you to pass the complete set of email ids to from field of outlook retrieve mails action, flow think a single mail has been recieved from these 2 email ids which may eb not possible, That is why flow does not received any attachments for that specific email. remember that , passing emails id in from field like above looks like an And condition rather than OR. 

     

    Just thought of one idea here,

     

    I am not sure whether it is possible as of now, The process of what you are doing now would be quite easy if in excel cell if we can specify a group mailbox instead , so that instead of emails a@abc.com;b@abc.com we can specify a group mailbox so that all clients of that domain can easily receive emails if they have access to group mailbox. Also you don't have to manually add/remove the email id in group mailbox as it will be updated in shared mailbox.

     

    Let me know your thoughts 🙂

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • TTC Profile Picture
    Super User 2024 Season 1 on at

    Hi Nived,

    Are you saying, you want me to create a group mailbox for all the client's email addresses under the company name 'Troy' and then what? Is that mean the script won't go after the excel sheet anymore?  Is there a way you can give this with more detail?  I am kind a little bit loss here.  I mean I can create a group mailbox if this is what you want me to do.  Please let me know.

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @TTC 

     

    What i meant is instead of making the code to look for mails from indiviual email ids of same company/clients, if all persons of same client can send an email from a group mailbox , would that be easy for you ?

     

    So currently you are writig email id of person of that company in the Carrier Contact Domain Email column like below

    Nived_Nambiar_0-1696437952658.png

     

    so for @dbke.com  if all persons of that clients send a mail from group mailbox , like for example abc@dbke.com which represent in groupmailbox, then there is no need of specifying the indiviual mail ids in excel cell, you can just specify the groupmailbox id instead. That would be easy 🙂

     

    Hope that helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 450

#2
Haque Profile Picture

Haque 366

#3
Valantis Profile Picture

Valantis 349

Last 30 days Overall leaderboard