Hi
I am looking for sending email from javascript/jquery/COM in SharePoint 2010.
I have code that insert item in list using JavaScript client object model .
After insert operation I need to send mail to value of one of columns (User field) in list insert operation
Any pointers will be very useful .Thanks.
try like this:
string webUrl = “http://Server/”;
ClientContext context = new ClientContext(webUrl);
User user = context.Web.EnsureUser(“loginname”);
context.Load(user);
context.ExecuteQuery();
EmailProperties properties = new EmailProperties();
properties.To = new string[] { user.LoginName };
properties.Subject = “Test subject”;
properties.Body = “Test body”;
Utility.SendEmail(context, properties);
context.ExecuteQuery(); // ServerException thrown here
context.Dispose();