Hi all,
I am having trouble with temporarily disable email notification while updating items so the system will not send out any unnecessary email. What I am trying to accomplish is that disable alert, updates item, then enable alert back.
SPList tasklist = Web.Lists["Tasks"];
tasklist.EnableAssignToEmail = false; //This property makes sending mail disabled
tasklist.Update();
//Do all the update here
Item["Title"] = "New Title"; Item.update();
tasklist.EnableAssignToEmail = true; //enable email notification
tasklist.Update();
As soon as I enabled back the alert, the changes made in the middle of the code still kick off the alert and send email out.
Anyone have better idea to solve this? Thank you.