I will explain as steps wise..
step1: For receiving mail to share point list you should have SMTP server install on your computer with its domain name properly configured
Step2: In Central Administration site in Operation section incoming mail settings needs to be done Here you will have to mention the name of domain server to which mail will be sent.
Step3: After done with all this the important factor is you will have to write the Email Receiver Handler library and register it to the specified share-point list. This event will fire whenever it receives mail and process as per the business logic you written in it.The DLL must need to add at GAC.
Step4: After registering the handler to list go to list settings.In communication tab there must be on link called In Coming Email settings. Click it and give the email address for this list.
Step5: Once done with above steps shoot a mail to specified library and check it out in C:\inetput\mailroot\drop folder . The mail comes first at here then Share point timer service is checking after one min duration for this folder.It transfer it to given list address.
Now I will give some code stuff for writing handler
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.EmailIntegration;
using System.Text.RegularExpressions;
namespace EmailReceiverHandlers
{
///
/// This class adds custom data from email to list
///
class MailEventHandler : SPEmailEventReceiver
{
SPListItem item;
public override void EmailReceived(SPList list, SPEmailMessage emailMessage, string receiverData)
{
try
{
list.ParentWeb.AllowUnsafeUpdates = true;
list.EnableAssignToEmail = true;
list.EnableAttachments = true;
item = list.Items.Add();
item["Title"] = emailMessage.Headers["subject"].ToString();
item.Update();
}
catch (Exception ex)
{
// EventLog.WriteEntry(sSource, "Error occured in EmailReceived method of class
MailEventHandler of type " + ex.Message, EventLogEntryType.Error);
}
}
}
Use OWSTIMER process from attach process for debugging the code.
Thanks..!