title: how to parse emails faster than OpenPop.dll
body: <p>it is possible using OpenPop.dll. </p>
  
  <pre><code>    Pop3Client objPOP3Client = new Pop3Client();
      int intTotalEmail = 0;
      DataTable dtEmail = new DataTable();
      object[] objMessageParts;
  
      try
      {
          dtEmail = GetAllEmailStructure();
  
          if (objPOP3Client.Connected)
              objPOP3Client.Disconnect();
  
          objPOP3Client.Connect(strHostName, intPort, bulUseSSL);
          try
          {
              objPOP3Client.Authenticate(strUserName, new Common()._Decode(strPassword));
              intTotalEmail = objPOP3Client.GetMessageCount();
  
              AddMapping();
  
              for (int i = 1; i &lt;= intTotalEmail; i++)
              {
                  objMessageParts = GetMessageContent(i, ref objPOP3Client, dtExistMailList);
  
                  if (objMessageParts != null &amp;&amp; objMessageParts[0].ToString() == "0")
                  {
                      AddToDtEmail(objMessageParts, i, dtEmail, dtUserList, dtTicketIDList, dtBlacklistEmails, dtBlacklistSubject, dtBlacklistDomains);
                  }
              }
          }
          catch (Exception ex)
          {
          }
      }
      catch (Exception ex)
      {
          ParserLogError(ex, "GetAllEmail()");
      }
      finally
      {
          if (objPOP3Client.Connected)
              objPOP3Client.Disconnect();
      }
  
      // function
  
       public object[] GetMessageContent(int intMessageNumber, ref Pop3Client objPOP3Client, DataTable dtExistingMails)
    {
      object[] strArrMessage = new object[10];
      Message objMessage;
      MessagePart plainTextPart = null, HTMLTextPart = null;
      string strMessageId = "";
  
      try
      {
          strArrMessage[0] = "";
          strArrMessage[1] = "";
          strArrMessage[2] = "";
          strArrMessage[3] = "";
          strArrMessage[4] = "";
          strArrMessage[5] = "";
          strArrMessage[6] = "";
          strArrMessage[7] = null;
          strArrMessage[8] = null;
          strArrMessage[7] = "";
          strArrMessage[8] = "";
  
          objMessage = objPOP3Client.GetMessage(intMessageNumber);
          strMessageId = (objMessage.Headers.MessageId == null ? "" : objMessage.Headers.MessageId.Trim());
  
          if (!IsExistMessageID(dtExistingMails, strMessageId)) //check in data base message id is exists or not 
          {
              strArrMessage[0] = "0";
              strArrMessage[1] = objMessage.Headers.From.Address.Trim();     // From EMail Address
              strArrMessage[2] = objMessage.Headers.From.DisplayName.Trim(); // From EMail Name
              strArrMessage[3] = objMessage.Headers.Subject.Trim();// Mail Subject     
              plainTextPart = objMessage.FindFirstPlainTextVersion();
              strArrMessage[4] = (plainTextPart == null ? "" : plainTextPart.GetBodyAsText().Trim());
              HTMLTextPart = objMessage.FindFirstHtmlVersion();
              strArrMessage[5] = (HTMLTextPart == null ? "" : HTMLTextPart.GetBodyAsText().Trim());
              strArrMessage[6] = strMessageId;
              List&lt;MessagePart&gt; attachment = objMessage.FindAllAttachments();
              strArrMessage[7] = null;
              strArrMessage[8] = null;
              if (attachment.Count &gt; 0)
              {
                  if (attachment[0] != null &amp;&amp; attachment[0].IsAttachment)
                  {
                      strArrMessage[7] = attachment[0].FileName.Trim();
                      strArrMessage[8] = attachment[0];
                  }
              }
          }
          else
          {
              strArrMessage[0] = "1";
          }
      }
      catch (Exception ex)
      {
          ParserLogError(ex, "GetMessageContent()");
      }
      return strArrMessage;
   }
  </code></pre>
  
  <p>but, i want to make it faster than above OpenPop.dll. so please let me know if any other technique are there for parsing mails.</p>
  
  <p>please check code and then tell me.</p>
  
  <p>Thanks in advance</p>