Forwarding email

Harry Jaggard 1 Reputation point
2022-04-06T09:18:09.63+00:00

Hi everyone,

I want to forward all email from my company's email that contains some specific keywords to another webmail. How can I fill the trigger part and do it?

Thank you so much!

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,933 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AtulThorat-MSFT 391 Reputation points
    2022-04-28T16:54:36.73+00:00

    Hi @Harry Jaggard ,

    Hope you are doing well.

    We can create Message Rule using below graph api endpoint.

    Please refer mailfolder-post-messagerules microsoft article for the same.

    Outlook carries out those actions if an incoming message in the user's Inbox meets the specified conditions.

    Permissions  
      
    Delegated (work or school account)     MailboxSettings.ReadWrite  
    Delegated (personal Microsoft account) MailboxSettings.ReadWrite  
    Application                            MailboxSettings.ReadWrite  
    
    Graph API Endpoint  
      
    POST https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messageRules  
      
    Request Header  
      
    Content-type: application/json  
      
    Request Body  
      
    {  
        "displayName": "Keyword Rule",  
        "sequence": 1,  
        "isEnabled": true,  
        "conditions": {  
            "bodyContains": [  
                "test"  
            ]  
        },  
        "actions": {  
            "forwardTo": [  
                {  
                    "emailAddress": {  
                        "name": "User Name",  
                        "address": "user@o365xx.onmicrosoft.com"  
                    }  
                }  
            ],  
            "stopProcessingRules": true  
        }  
    }  
      
    Graph API Response  
      
    {  
        "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('6ab5cc33-a9d6-40b1-a84f-993e06d170f3')/mailFolders('inbox')/messageRules/$entity",  
        "id": "AQAAAEegLYU=",  
        "displayName": "Keyword Rule",  
        "sequence": 1,  
        "isEnabled": true,  
        "hasError": false,  
        "isReadOnly": false,  
        "conditions": {  
            "bodyContains": [  
                "test"  
            ]  
        },  
        "actions": {  
            "stopProcessingRules": true,  
            "forwardTo": [  
                {  
                    "emailAddress": {  
                        "name": "User Name",  
                        "address": "user@o365xx.onmicrosoft.com"  
                    }  
                }  
            ]  
        }  
    }  
    

    197360-rule-creation.png

    So in this way you can forward email that contains specific keyword to another user with webmail

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments