Skip to content

Latest commit

 

History

History
59 lines (49 loc) · 1.28 KB

File metadata and controls

59 lines (49 loc) · 1.28 KB

Examples

Connecting to an POP3 server using SSL

using System;
using S22.Pop3;

namespace Test {
	class Program {
		static void Main(string[] args)
		{
			using (Pop3Client Client = new Pop3Client("pop.gmail.com", 995,
			 "username", "password", Authmethod.Login, true))
			{
				Console.WriteLine("We are connected!");
			}
		}
	}
}

Download new mail messages

using System;
using S22.Pop3;

namespace Test {
	class Program {
		static void Main(string[] args)
		{
			using (Pop3Client Client = new Pop3Client("pop.gmail.com", 995,
			 "username", "password", Authmethod.Login, true))
			{
				MailMessages[] messages = Client.GetMessages();
			}
		}
	}
}

Download mail headers only instead of the entire mail message

using System;
using S22.Pop3;

namespace Test {
	class Program {
		static void Main(string[] args)
		{
			using (Pop3Client Client = new Pop3Client("pop.gmail.com", 995,
			 "username", "password", Authmethod.Login, true))
			{
				MailMessage[] messages = Client.GetMessages(null, FetchOptions.HeadersOnly);
			}
		}
	}
}