Saving Attachments
The following example demonstrates saving all of the attachments of an email to a directory.

[C#]

//create a new pop3 object POP3 pop = new POP3("127.0.0.1","dave@blah.com", "mypassword" ); //connect to the POP3 server pop.Connect(); MimeMessage msg = pop.GetMessage(0); //save attachments to a directory msg.SaveAttachments( "c:\\temp\\mydirectory\\", true ); pop.Disconnect(); //done Console.WriteLine( "done."); Console.ReadLine( );


[VB.NET]

'create a new pop3 object Dim pop As New POP3("127.0.0.1", "dave@blah.com", "mypassword") 'connect to the POP3 server pop.Connect() Dim msg As MimeMessage = pop.GetMessage(0) 'save attachments to a directory msg.SaveAttachments("c:\temp\mydirectory\", True) pop.Disconnect() 'done Console.WriteLine("done.") Console.ReadLine()