Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package jadex.bdi.planlib.messaging;
 
 
Test class for java mail API.
public class MailTest
{
Main method for testing.

	public static void	main(String[] argsthrows MessagingExceptionIOException
	{
		Session	session	= Session.getDefaultInstance(System.getProperties());
		URLName	urlnew URLName("pop3""localhost", 110, """test@mydomain.com""test");
		Store	storesession.getStore(url);
		store.connect();
		Folder	inboxstore.getFolder("INBOX");
		if(inbox.getMessageCount()>0)
		{
			for(int i=0; i<inbox.getMessageCount(); i++)
			{
				Message	messageinbox.getMessage(i+1);
			}
		}
		else
		{
			..println("No new messages.");
		}
	}
New to GrepCode? Check out our FAQ X