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 ......