0

I am trying to send an email to an address retrived by a custom REST service.

Having got the email address I set it to a variable myemailvariable

Now I would like to send an email to that address.

I have tried creating a message in the workflow and set the email as follows:

  1. Workflow Lookup for a User
  2. Workflow Parameters and Users
  3. FieldFromSource = myemailvariable

but it fails on SendEmail with the following error:

SocialRESTExceptionProcessingHandler.DoServerExceptionProcessing - SharePoint Server Exception [System.InvalidOperationException: A recipient must be specified.    
 at System.Net.Mail.SmtpClient.Send(MailMessage message)    
 at Microsoft.SharePoint.Utilities.SPUtility.SendEmail_Client(EmailProperties properties)    
 at Microsoft.SharePoint.ServerStub.Utilities.SPUtilityServerStub.InvokeStaticMethod(String methodName, ClientValueCollection xmlargs, ProxyContext proxyContext, Boolean& isVoid)    
 at Microsoft.SharePoint.Client.ServerStub.InvokeStaticMethodWithMonitoredScope(String methodName, ClientValueCollection args, ProxyContext proxyContext, Boolean& isVoid)    
 at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPathRoot(Boolean mainRequestPath, EdmParserNode node, Boolean resourceEndpoint, MethodInformation& methodInfo)    
 at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPath(Boolean mainRequestPath, String path, String pathForErrorMessage)    
 at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.Process()    
 at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ProcessRequest()

Do you know how to send an email to an address retrieved by a custom REST service with workflows? I'd like to do it staying in SharePoint Designer (thus without writing code)

  • Have you check that your workflow is correctly getting your email address (ex: log in history the variable) ? I would also try to get the email address by hand then use the output to hardcode it in the Send an email action and see if if it's working correctly. – JayHell Apr 29 '16 at 12:04
  • @JayHell I'm sure the email is correct as I also insert it in a list item. If I hardcode it, the email is sent correctly. But I see, in this case there is some kind of translation from email to user as I see in the email recipient in the workflow Name and Surname corresponding to that user. I think if you created a variable with an email and tried to send an email to that variable it would fail. – Gyonder Apr 29 '16 at 12:23
  • All "Return field as" output options fail ? – JayHell Apr 29 '16 at 12:41
  • Could you tell me the step to turn a string into a user with "Return field as"? – Gyonder Apr 29 '16 at 12:52
  • 1
    Check the screenshot in this answer : sharepoint.stackexchange.com/questions/62787/… – JayHell Apr 29 '16 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.