Search This Blog

Tuesday, June 28, 2011

The event handler will simply copy a newly added list item’s title in to another list.

public override void ItemAdded(SPItemEventProperties properties)
{
base.ItemAdded(properties);
SPWeb web = properties.OpenWeb();

SPList list = web.Lists["contacts"];

string alladdress=properties.ListItem["To"] + ";" + properties.ListItem["CC"];
string[] addresses = alladdress.Split(';');
foreach (string emails in addresses)
{

SPListItem item = list.Items.Add();
string[] nameid = emails.Split('@');
item["Email"] = emails;
item["FirstName"] = nameid[0];
item["Title"] = " ";
item.Update();
}
list.Update();
web.Close();


}



No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

Discover powerful tools for digital investigations, IP intelligence, threat hunting, exposed services, data breach research and satellite imagery.

14 Powerful OSINT Tools for Cybersecurity | BytesXplorer </> Bytes Xplorer TECHNOLOGY • ...