Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to send an email after an action occurs in Silverlight WebPart I am designing.

Is there a built-in class in the Client Object Model that can handle this, or will I have to build a custom web-service that wraps the SPUtility.SendEmail functionality?

share|improve this question

3 Answers 3

I don't know of anything in the Client Object Model that lets you do this directly, but if you don't want to have to deploy a custom web service, you could probably make a list with a simple workflow that sends an email, and then just have your web part put an entry in the list and make sure it contains the columns you'll need to build the email message in the workflow.

share|improve this answer

Create the custom Web service then use it in your application.

share|improve this answer

There's no such built-in functionality. In addition to two methods to achieve your goal from the similar thread provided by Falak Mahmood I can offer another one and easiest in my opinion. You can add an ASP.NET Ajax callback to your web part. Here's an example: http://ajaxzen.wordpress.com/tag/icallbackeventhandler/ Then you need only to call it from client code in your webpart and to use SPUtility.SendEmail in server-side callback handler. It's really a dozen lines of code and doesn't require such complex dependencies as custom webservice or special list with special workflow or event receiver or anything else.

Actually I did similar task myself with this method and it works perpectly. :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.