Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Question: How to get email id of the email sender if it has more than 1 email address in CRM?

Posted on by 55,410

Hi,

If I receive an email from a contact which has 3 email id's in my crm. How do we know what's the email id used in that email.

*This post is locked for comments

  • arif imteyaz Profile Picture
    arif imteyaz 375 on at
    RE: Question: How to get email id of the email sender if it has more than 1 email address in CRM?

    if (entity.LogicalName == "email")

                       {

                           if (entity.Contains("directioncode"))

                           {

                               if (((Boolean)entity["directioncode"]) == false)

                               {

                                   EntityCollection M = ((EntityCollection)entity.Attributes["from"]);

                                   string subject = ((string)entity.Attributes["subject"]);

    }

    }

    }

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Question: How to get email id of the email sender if it has more than 1 email address in CRM?

    Create a Query in your plugin code (on the receive message of the email) to query the email address on the Contact entity with multiple conditions

    WHERE fromAddress = emailAddress1 OR fromAddress = emailAddress2 OR fromAddress = emailAddress3.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Question: How to get email id of the email sender if it has more than 1 email address in CRM?

    Hi Ravi,

    you could try with a plugin, intercepting the create message of the email:

    ...
    EntityCollection partycoll = email.GetAttributeValue<EntityCollection>("from"); if (partycoll != null) { foreach(Entity party from particoll.Entities.ToList()) { string emailaddress = party.GetAttributeValue<string>("addressused"); } }
    ...

    Please, let us know.

    NB: before to implement the plugin you can try do it throught a console application, after retrieving an email record

    If you found the answer helpful, please mark as Verified 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Question: How to get email id of the email sender if it has more than 1 email address in CRM?

    1 contact with 3-email id.  e.g. ravi.kashyap@gmail.com

    ravi.kashyap@live.com

    ravi.kashyap@in.com

    if

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Question: How to get email id of the email sender if it has more than 1 email address in CRM?

    You mean 3 contacts with the same email address, or 1 contact with 3 email addresses?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans