WebHosting

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

How to Enable and Configure Remote Desktop (RDP) on Ubuntu 24.04.4 LTS

Remote Desktop Protocol (RDP) support in Ubuntu has become considerably easier with the GNOME Remote Desktop stack included in modern Ubuntu...