English 中文(简体)
电子邮件下载(反馈)
原标题:
  • 时间:2009-05-29 15:46:16
  •  标签:

是否有任何人知道如何将每个电子邮件的大批垃圾堆放到档案中去。

我期望写出一个方案,使用户能够回馈电子邮件(可能的话是用不上)并反馈到个人档案或星号(我知道,最可能更困难)。

最佳回答

一段时间前,我就同一专题写了博客。 见http://blog.rebex.net/news/archive/2007/05/14/howto-download-emails- from-gmail-account-in-csharp.aspx“rel=” HOWTO:down emails from a Gmail account in C#, for details.

守则使用我们的Rebex 邮件部分:

using Rebex.Mail;
using Rebex.Net;
...
// create the POP3 client
Pop3 client = new Pop3();
try
{

   // Connect securely using explicit SSL. 
   // Use the third argument to specify additional SSL parameters. 
   Console.WriteLine("Connecting to the POP3 server...");
   client.Connect("pop.gmail.com", 995, null, Pop3Security.Implicit);

   // login and password
   client.Login(email, password);

   // get the number of messages
   Console.WriteLine("{0} messages found.", client.GetMessageCount());

   // -----------------
   // list messages
   // -----------------

   // list all messages
   ListPop3MessagesFast(client); // unique IDs and size only   
   //ListPop3MessagesFullHeaders(client); // full headers
}
finally
{
   // leave the server alone
   client.Disconnect();      
}


public static void ListPop3MessagesFast(Pop3 client)
{
   Console.WriteLine("Fetching message list...");

   // let s download only what we can get fast
   Pop3MessageCollection messages = 
      client.GetMessageList(Pop3ListFields.Fast);

   // display basic info about each message
   Console.WriteLine("UID | Sequence number | Length");
   foreach (Pop3MessageInfo messageInfo in messages)
   {
      // display header info
      Console.WriteLine
      (
         "{0} | {1} | {2} ",
         messageInfo.UniqueId,
         messageInfo.SequenceNumber,
         messageInfo.Length
      );

      // or download the whole message
      MailMessage mailMessage = client.GetMailMessage(messageInfo.SequenceNumber);
   }   
}
问题回答

Gmail provide POP access。 因此,仅使用library,允许你使用持久性有机污染物进行交流,并再用金进行。

<><>Edit>: 我刚刚注意到,你提到了北极监测计划;我建议你将持久性有机污染物用于大型垃圾场。 你们想要做的事情太好了。

如果你必须使用国际项目评估方案,请上

There is an open-source Python program compiled to Windows (using py2exe) at https://github.com/jay0lee/got-your-back/wiki

但是,宏观用户需要加以汇编(由于错误错误,我没有完全数字)。

不管怎么说,你还需要一种方式,以便按时间表自动执行该方案。





相关问题
热门标签