15

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?

Artel DeVries
  • 151
  • 1
  • 3

3 Answers3

4

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.

Sam Yates
  • 406
  • 2
  • 5
1

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

Basant B. Pandey
  • 447
  • 1
  • 8
  • 21
0

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. :)

Alex Boev
  • 3,283
  • 16
  • 13