2012-06-06 2 views

답변

1

S22.Imap으로 가거나 (또는보십시오). 그것은 일부 엑스트라로 문서화 된 AE.Net.Mail입니다. 예부터

: 그들은 그냥 Yandex 주차 사서함에`SentSince` 검색 필터를 시도하고이 제대로 작동하지 않습니다

using System; 
using S22.Imap; 

namespace Test { 
class Program { 
    static void Main(string[] args) 
    { 
     using (ImapClient Client = new ImapClient("imap.gmail.com", 993, 
     "username", "password", Authmethod.Login, true)) 
     { 
      // This returns all messages sent since August 23rd 2012 
      uint[] uids = Client.Search(
       SearchCondition.SentSince(new DateTime(2012, 8, 23)) 
      ); 

      // Our lambda expression will be evaluated for every MIME part 
      // of every mail message in the uids array 
      MailMessage[] messages = Client.GetMessages(uids, 
       (Bodypart part) => { 
       // We're only interested in attachments 
       if(part.Disposition.Type == ContentDispositionType.Attachment) 
       { 
        Int64 TwoMegabytes = (1024 * 1024 * 2); 
        if(part.Size > TwoMegabytes) 
        { 
         // Don't download this attachment 
         return false; 
        } 
       } 

       // fetch MIME part and include it in the returned MailMessage instance 
       return true; 
       } 
      ); 
     } 
    } 
} 
} 
+0

보다 작은 2 메가 바이트가있는 경우에만 첨부 파일을 다운로드 - 내가 가지고있는 모든 이메일을 반환합니다. 라이브러리의 결함 일 필요는 없습니다. – chester89

관련 문제