Home | Contact Us | Download | Support | Purchase | Shopping Cart | Products


Product List
  "The Advanced Intellect components I've used (aspNetEmail, aspNetPOP3, aspNetMX) have all been well-designed and reliable. These products have added key functionality to my applications, but my greatest recommendation relates to Dave's friendly and bend-over-backwards support. When I had questions, he was easy to reach, courteous and helpful. Thanks so much!"
Michael Kane
CTO, Commontales
 
More
Testimonials

Saving Attachments

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

[C#]

using System;
using aspNetPOP3;
using aspNetMime;
namespace cstest
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
			//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(1 );
			
			//save attachments to a directory
			msg.SaveAttachments( "c:\\temp\\mydirectory\\", true );

			pop.Disconnect();
            
			//done
			Console.WriteLine( "done.");
			Console.ReadLine( );
            
		}
	}
}

 

[VB.NET]

Imports aspNetPOP3
Imports aspNetMime

Module Module1

    Sub Main()

        '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(1)

        'save attachments to a directory
        msg.SaveAttachments("c:\temp\mydirectory\", True)

        pop.Disconnect()

        'done
        Console.WriteLine("done.")
        Console.ReadLine()

    End Sub

End Module

 

 

 



The box is not shipped. aspNetPOP3 is a downloadable product.