I have a Web Part in SharePoint 2010 that has an Event Receiver that fires when an item is added to a list. The Event Receiver is supposed to send a mail but does not.
It works fine when I try without the Event Receiver, how can I send mail using an Event Receiver?
StringDictionary headers = new StringDictionary();
string body = "Hi!";
headers.Add("to", "[email protected]");
headers.Add("from", "[email protected]");
headers.Add("subject", "Paulo says hi");
headers.Add("content-type", "text/html");
SPUtility.SendEmail(web, headers, body)
Thank you for helping.