I'm a newbie of SharePoint 2010.
I would like to send an email when a user click on a specified custom button relative to an element in a list.
I would like to add into the body of the email some informations about the selected element like the column "Title" or the "Author".
I've found this code to send email and I've copied it into an .aspx page. This page also receive one parameter by querystring. The parameter is "list_name" that specifies the name of the list where button is clicked. I think this could be used to specify the SP list somewhere in the code, but I don't know exactly where and how do it.
StringDictionary headers = new StringDictionary(); string bodyTxt = "<b>Test Mail Bold</b>"; //for html mail body, you can send unformatted text too… headers.Add("to", "email@example.com"); headers.Add("from", "firstname.lastname@example.org"); headers.Add("subject", "Richiesta scambio prenotazione"); headers.Add("content-type", "text/html"); //for html mail body SPUtility.SendEmail(properties.web, headers, bodyTxt);
But my (probably stupid) question is: How can I retrieve data from the list and use it in this .aspx page that sends the email?