Thursday, September 4, 2008

E-Mail notifications in Task List

Hi All,

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


That's it. your job is done.


Anonymous said...

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

SharePoint Kings said...

may be timer job will be your solution.

check this link for creating and working with timer job

Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to