How to send email to specific email address instead of CRM User/Enity ?

How to send email to specific email address instead of CRM User/Enity ?

At standard operation email is being sent to EntityReference object corresponding to: User, Contact etc. Entity reference is being converted anyway into ActivityParty object. So, why not to use ActivityParty just from email address collection: private const string HtmlMimeType = @"Content-Type: text/html; charset=UTF-8"; private const string PlainTextMimeType = @"Content-Type: text/plain; charset=UTF-8"; public void CreateEmail(string title, string […]

Where to find Server Address And Organization Name in plugin?

Where to find Server Address And Organization Name in plugin?

If you would create client application which use OrganizationServiceProxy answer to question is easy: var proxy = service as OrganizationServiceProxy; var scheme = proxy.EndpointSwitch.PrimaryEndpoint.Scheme; var serverAddress = proxy.EndpointSwitch.PrimaryEndpoint.Host; var organizationName = proxy.EndpointSwitch.PrimaryEndpoint.Segments.Length < 2 ? UndefinedValue : proxy.EndpointSwitch.PrimaryEndpoint.Segments[1].Replace("/", string.Empty); If you use LocalPluginContext organization name is available: localContext.PluginExecutionContext.OrganizationName But, what with other parameters, ex. servername […]