使用pop3将Gmail检索到.net应用程序 [英] Retrive Gmail to .net application using pop3

查看:77
本文介绍了使用pop3将Gmail检索到.net应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我尝试使用pop3从gmail检索邮件,但邮件数没有增加.
m仅接收508封邮件,如何根据日期检索邮件.

在此先感谢.

在y邮件中,我有直到日期的邮件,但仅显示仍在4月4日收到的邮件
这是获取电子邮件计数的代码

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

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;
      }


但我只收到508,但邮件却超过508

这是在电子邮件ID上获取电子邮件的代码,表示计数


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

here is code to fetch emails on email id means count

 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;
}


但我需要按日期获取电子邮件是他们的任何Google API以便按日期获取邮件

感谢yo


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

thank yo

推荐答案

请参考:
使用Windows窗体构建简单的Gmail通知程序 [使用c#的POP3客户端 [使用C#从POP3服务器检索邮件 [ ^ ]

请参考以下内容:
在ASP.NET中阅读Gmail收件箱邮件 [ ^ ]
Please refer:
Build a Simple Gmail Notifier using Windows Forms[^]
POP3 client using c#[^]

CP article: Retrieve Mail From a POP3 Server Using C#[^]

Have look on this for reference:
Read Gmail Inbox Message in ASP.NET[^]


这篇关于使用pop3将Gmail检索到.net应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆