728x90
반응형
728x170
using System.Collections.Generic;
using OpenPop.Mime;
using OpenPop.Pop3;
#region 모든 메일 리스트 구하기 - GetAllMailList(hostName, port, useSSL, userName, password)
/// <summary>
/// 모든 메일 리스트 구하기
/// </summary>
/// <param name="hostName">호스트명</param>
/// <param name="port">포트</param>
/// <param name="useSSL">SSL 사용 여부</param>
/// <param name="userName">사용자명</param>
/// <param name="password">패스워드</param>
/// <returns>모든 메일 리스트</returns>
public List<Message> GetAllMailList(string hostName, int port, bool useSSL, string userName, string password)
{
using(Pop3Client client = new Pop3Client())
{
client.Connect(hostName, port, useSSL);
client.Authenticate(userName, password);
int messageCount = client.GetMessageCount();
List<Message> list = new List<Message>(messageCount);
for(int i = messageCount; i > 0; i--)
{
list.Add(client.GetMessage(i));
}
return list;
}
}
#endregion
728x90
반응형
그리드형(광고전용)
'C# > OpenPop' 카테고리의 다른 글
[C#/OPENPOP] Message 클래스 : FindFirstMessagePartWithMediaType 메소드를 사용해 메시지 포함 이미지 구하기 (0) | 2021.07.31 |
---|---|
[C#/OPENPOP] Pop3Client 클래스 : GetMessageHeaders 메소드를 사용해 메일 헤더 조사하기 (0) | 2021.07.31 |
[C#/OPENPOP] Message 클래스 : Load 정적 메소드를 사용해 메시지 로드하기 (0) | 2021.07.31 |
[C#/OPENPOP] Message 클래스 : Save 메소드를 사용해 메시지 저장하기 (0) | 2021.07.31 |
[C#/OPENPOP] Pop3Client 클래스 : DeleteMessage 메소드를 사용해 메일 삭제하기 (0) | 2021.07.31 |
[C#/OPENPOP] Message 클래스 : FindFirstMessagePartWithMediaType 메소드를 사용해 XML 메시지 저장하기 (0) | 2021.07.31 |
[C#/OPENPOP] Message 클래스 : FindFirstHtmlVersion 메소드를 사용해 HTML 메시지 저장하기 (0) | 2021.07.31 |
[C#/OPENPOP] Message 클래스 : FindFirstPlainTextVersion 메소드를 사용해 평문 텍스트 메시지 저장하기 (0) | 2021.07.31 |
[C#/OPENPOP] POP3 프로토콜을 사용해 메일 가져오기 (0) | 2021.07.27 |
[C#/OPENPOP] 누겟 설치 : OpenPop.NET (0) | 2021.07.27 |
댓글을 달아 주세요