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

#Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc

 #Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc Linux is an open-source operating system that is loved by millio...