All Projects → rfinochi → pop3dotnet

rfinochi / pop3dotnet

Licence: MIT license
Small and simple library for retrieving messages from Post Office Protocol version 3 (POP3) servers with full support for .NET 4.8, .NET Standard 2.1 and asynchronous programming model.

Programming Languages

C#
18002 projects
smalltalk
420 projects

Small and simple library for retrieving messages from Post Office Protocol version 3 (POP3) servers with full support for .NET 4.8, .NET Standard 2.1 and asynchronous programming model.

Build status Coverage Status Total alerts CodeFactor Grade CII Best Practices Summary Issues Code Size Latest Release Latest Version Downloads OSS Lifecycle License

How to use

Connect to Pop3 Server:

Pop3Client pop3Client = new Pop3Client( );
pop3Client.Connect( "SERVER", "USERNAME", "PASSWORD", true );

Retrieve message list:

var messages = pop3Client.List( );

Retrieve messages:

foreach ( Pop3Message message in messages )
{ 
	pop3Client.Retrieve( message );
	
	Console.WriteLine( "MessageId: {0}", message.MessageId );
	Console.WriteLine( "Date: {0}", message.Date );
	Console.WriteLine( "From: {0}", message.From );
	Console.WriteLine( "To: {0}", message.To );
	Console.WriteLine( "Subject: {0}", message.Subject );
} 

Disconnect from the server:

pop3Client.Disconnect( );

How to use in asynchronously way

Connect to Pop3 Server:

Pop3Client pop3Client = new Pop3Client( );
await pop3Client.ConnectAsync( "SERVER", "USERNAME", "PASSWORD", true );

Retrieve message list:

var messages = await pop3Client.ListAsync( );

Retrieve messages:

foreach ( Pop3Message message in messages )
{ 
	await pop3Client.RetrieveAsync( message );
	
	Console.WriteLine( "MessageId: {0}", message.MessageId );
	Console.WriteLine( "Date: {0}", message.Date );
	Console.WriteLine( "From: {0}", message.From );
	Console.WriteLine( "To: {0}", message.To );
	Console.WriteLine( "Subject: {0}", message.Subject );
} 

Disconnect from the server:

await pop3Client.DisconnectAsync( );
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].