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?
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With