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


//create a new pop3 object POP3 pop = new POP3("","", "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( );


'create a new pop3 object Dim pop As New POP3("", "", "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()