cja
cja

Reputation: 10016

"You cannot send e-mail as the selected user" - Who are "you" and "selected user"?

Dynamics CRM 2011 on premise.

I have a process that is triggered on close of a case/incident and it sends an email from the owner of the case.

The process is owned by Mick. Andy is the owner of a case and closes it.

A job runs and is stuck at Waiting. There's a warning in the job saying

"You cannot send e-mail as the selected user. The selected user has not allowed this or you do not have sufficient privileges to do so. Contact your system administrator for assistance."

With the following stack trace:

Plugin Trace:

[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.SendEmail]
[SendEmailStep7]



Error Message:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: User does not have send-as privilege.Detail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147203059</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>User does not have send-as privilege.</Message>
  <Timestamp>2013-09-27T13:55:42.6567419Z</Timestamp>
  <InnerFault>
    <ErrorCode>-2147203059</ErrorCode>
    <ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <Message>User does not have send-as privilege.</Message>
    <Timestamp>2013-09-27T13:55:42.6567419Z</Timestamp>
    <InnerFault i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <TraceText>[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.SendEmail]
[SendEmailStep7]
</TraceText>
</OrganizationServiceFault>
   at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)
   at Microsoft.Crm.Extensibility.InprocessServiceProxy.ExecuteCore(OrganizationRequest request)
   at Microsoft.Crm.Workflow.Services.SendEmailActivityService.<>c__DisplayClass1.<SendEmailInternal>b__0(IOrganizationService sdkService)
   at Microsoft.Crm.Workflow.Services.ActivityServiceBase.ExecuteInTransactedContext(ActivityDelegate activityDelegate)
   at Microsoft.Crm.Workflow.Services.SendEmailActivityService.ExecuteInternal(ActivityContext executionContext, SendEmail sendEmail)
   at Microsoft.Crm.Workflow.Services.SendEmailActivityService.Execute(ActivityContext executionContext, SendEmail sendEmail)
   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

It would have been really helpful if Microsoft had used the words "Mick" and "Andy", but naturally they used the ambiguous "you" and "selected user" instead.

So, who are "you" and "selected user"?

Upvotes: 1

Views: 14128

Answers (3)

Eish
Eish

Reputation: 1081

Best answer here is from this blog entry

http://www.digital-transition.com/archives/2011/crm-2011-user-does-not-have-send-as-privilege/

Difficult problem to solve. The problem is even if you setup a System account to send the emails you still need each user's privilege to indicate they are willing other users (note all other users) to send email on their behalf and not just the System account, which in turn can create a security issue.

No 100% solution here unfortunately

Upvotes: 1

cja
cja

Reputation: 10016

Mick is "you". Andy is "selected user".

Fixed by Andy going to File > Options in CRM, then clicking the E-mail tab and ticking the top box, "Allow other Microsoft Dynamics CRM users to send e-mail on your behalf.", followed by OK.

I didn't find a way for an administrator to enable this option on behalf of the user. So if there are many users this would be expensive.

Sources:
My experimentation
http://social.microsoft.com/Forums/en-US/bf14014a-c682-492f-949d-bda3489f0c5a/you-cannot-send-email-as-the-selected-user-who-are-you-and-selected-user

Upvotes: 1

JimR
JimR

Reputation: 16133

This is telling you you cannot send email on behalf of another person or account.

You is the logged in account trying to send an email.

Selected user is most likely what is being put in the From field of the email being sent.

So, if you're logged in as Fred and you're trying to send email from Ethel you will fail without the right to send email on the behalf of another, which Microsoft calls the send-as privilege here.

The key part of the error is <Message>User does not have send-as privilege.</Message>

Upvotes: 1

Related Questions