Hello folks,
In a following post we will see how to write Email Event Receiver and retrieve the email related details.I am directly keeping the code by assuming that readers are aware of how to create Event Receivers in SharePoint.
In a following post we will see how to write Email Event Receiver and retrieve the email related details.I am directly keeping the code by assuming that readers are aware of how to create Event Receivers in SharePoint.
public class MobileApproval : SPEmailEventReceiver
{
/// <summary>
/// The list received an
e-mail message.
/// </summary>
public override void EmailReceived(SPList list, SPEmailMessage
emailMessage,
String receiverData)
String receiverData)
{
//
base.EmailReceived(list, emailMessage, receiverData);
// SPSite objSite =
new SPSite(site);
try
{
BAL objBAL = new BAL();
string subject = emailMessage.Headers["Subject"];
string body = emailMessage.PlainTextBody;
string status = string.Empty;
int index = subject.IndexOf('+');
string BPID = subject.Substring(0,
index);
status = subject.Substring(index + 1);
string
FromMail = emailMessage.Headers["From"];
int NameIndex = FromMail.IndexOf('<');
string FromMailID =
FromMail.Substring(0, NameIndex - 1);
}
catch(Exception ex)
{
//Exception Handling
}
catch(Exception ex)
{
//Exception Handling
}
}
0 comments:
Post a Comment