May times it happens that we require to send a custom mail to a person who is assigned a task and not the default one that sharepoint sends for the task allocation.
In GUI, we can get through this when we go to Tasks List Settings -> Advanced Settings -> E-Mail Notification -> Select No for this.
This will do when you do it with the Interface.
Many times you may require to do it with the code, because may be you might not take any schema for tasks list because it's already there when you use Team Site as a template for your site.
So you need to programmatically set this property to false and then MOSS stops sending default task assigned message to a person to whom task gets allocated with the help of services.
Simple right this line.
SPList tasklist = Web.Lists["Tasks"];
tasklist.EnableAssignToEmail = false; //This property makes sending mail disabled
tasklist.Update();
That's it. your job is done.
2 comments:
Hi, My requirement is different. I have to send email everyday morning to users of their completed, inprogress and overdue tasks in single mail. How can i do it
may be timer job will be your solution.
check this link for creating and working with timer job
Post a Comment