Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send email by simple email address using crm?

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?

like image 892
Damkulul Avatar asked Sep 14 '25 06:09

Damkulul


1 Answers

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"] = "[email protected]"
});

var recipients = new EntityCollection();
recipients.Entities.Add(new Entity("activityparty")
{
    ["addressused"] = "[email protected]"
});

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

organizationService.Create(eMail);
like image 190
Henk van Boeijen Avatar answered Sep 17 '25 18:09

Henk van Boeijen