3

I'm working with Dynamics CRM 2016, I want to send an Email from crm using an email address that the user insert (the email Id is taken from a field in incident-Entity and not from crm-user) according to examples online the option is to use entityreference from another entity that will hold and get the Email address, is there a way not to use Entityreference but instead get my email address from a simple field on incident form?

Damkulul
  • 1,406
  • 2
  • 25
  • 59

3 Answers3

3

You can use e-mail addresses that are not associated with e-mailaddress fields. It just requires a few steps.

In the UI navigate to Settings > System Settings > tab Email > header "Set Email form options".

Make sure setting "Allow messages with unresolved email recipients to be sent" is Yes.

Now you can use literal e-mail addresses like in this example:

var sender = new EntityCollection();
sender.Entities.Add(new Entity("activityparty")
{
    ["addressused"] = "me@home.test"
});

var recipients = new EntityCollection();
recipients.Entities.Add(new Entity("activityparty")
{
    ["addressused"] = "info@acme.test"
});

var eMail = new Entity("email")
{
    ["from"] = sender,
    ["to"] = recipients,
    ["subject"] = "Just a test",
    ["description"] = "Body of your e-mail"
};

organizationService.Create(eMail);
Henk van Boeijen
  • 7,357
  • 6
  • 32
  • 42
1

You can do it programmatically! You can send an email to a person who is not a Lead/Contact/Account.. The CRM will send email but it will show un resolved referenced when you open it in CRM

Yaqub Ahmad
  • 27,569
  • 23
  • 102
  • 149
-2

Update:

but instead get my email address from a simple field on incident form?

This is not possible in CRM UI. But possible using the code snippet from the blog link in comment. You have to query the textbox content and put in recipient party address.


(These two lines are for sending email to activity party email Id from associated record non-email field from CRM UI, without any code or customization for this particular scenario)

Unfortunately you cannot achieve it.

Only way is associated record.

  • so If I understand correctly I must save my email address in any entity record and can only pass that email by entityreference to the crm sendmail function. – Damkulul Oct 24 '17 at 12:34
  • 1
    Yes, CRM is all about relationship management :) you can read this, it may be helpful. http://worldofdynamics.blogspot.com/2012/04/dynamics-crm-2011-c-code-for-sending.html?m=1 – Arun Vinoth-Precog Tech - MVP Oct 24 '17 at 12:37