Question

I'm trying to send an email with sharepoint's SPUtility.SendEmail() method, but according to Visual studio it doesn't exist. I have using Microsoft.Sharepoint and .Utilities included, but still nothing.

Am I missing an assembly or something? I'm on Sharepoint 2013 in .NET 4.5

Code below. Visual studio doesn't show any suggestions when I type SendEmail for any overloads.

var web = SPContext.Current.Web;
SPUtility.SendEmail(web, false,false,"blank@blank.com","subject","message");
Was it helpful?

Solution

SPUtility.SendEmail() is not available in a sandbox solution.

You can use the SendEmail activity in a SharePoint Designer Workflow to accomplish your task.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top