Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am try to retrieve mail from gmail using pop3 but the mail count is not increasing.
m receiving only 508 mails ,how can i retrieve mails according to date.

thanks in advance.

in y mail i have mails till the date but it showing only mail received still April 4ht
here is code to get count of emails

C#
public int GetEmailCount()
      {
          int count = 0;
          string response = SendCommand("STAT");
          if (IsResponseOk(response))
          {
              string[] arr = response.Substring(4).Split(' ');
              count = Convert.ToInt32(arr[0]);
          }
          else
              count = -1;
          return count;
      }

but m getting 508 only as count but mails are more than 508

here is code to fetch emails on email id means count

C#
 public int FetchEmailList(int start, int count)
            {
                int emailCount = 0;
                count = 0;
                int i = start;
                List<email> emails = new List<email>(5);
                for (i = start; i > 0; i--)
                {
                    if (count != 5)
                    {
                        Email email = FetchEmail(i);
                        if (email != null)
                        {
                            string Subject = Convert.ToString(email.Subject);
                            string[] lines = Regex.Split(Subject, " ");
                            string Subject1 = lines[0];
                            if (Subject1 == "Contact" || email.From == "Must See India <cabs@mustseeindia.com>" || Subject1 == "Request" || Subject1 == "Feedback")
                            {
                                emails.Add(email);
                                count++;
                            }
                            emailCount++;
                        }
                    }
                    else
                    {

                        return emailCount;
                    }
                }

                return emailCount;
}

but i need to fetch emails on date is their any Google API to get mails on date

thank yo
Posted
Updated 24-May-12 21:37pm
v4
Comments
Sandeep Mewara 25-May-12 1:26am    
Its difficult to comment based on what you ask. If mail download is working then it should bring all on server. Update question with code and share how many emails are there in your inbox? Any archived?

Did you look at gmail documentation of the API you are using?
AmitGajjar 25-May-12 2:48am    
don't post everything. post the exact question and code.
AmitGajjar 25-May-12 2:52am    
one more suggestion, your first half code is not readable. and even very difficult to understand. add proper comment.
Neetesh Agarwal 13-Mar-13 7:48am    
Hi Navi, Did u get the exact answer If yes then post here. I also need to do this

Thanks

1 solution

 
Share this answer
 
v2
Comments
navi_s_Patil 25-May-12 2:16am    
hi Prasad_Kulkarni thanks for quick reply i have already used these links pop3 is not showing proper count of email. therefore m trying to retrieve mail on date i need to fetch only today mail.
Is there any API to fetch mail on date.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900