jadex.bdi.planlib.messaging.MailTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-applib-bdi Show documentation
Show all versions of jadex-applications-applib-bdi Show documentation
The Jadex applib BDI package contains ready to use functionalities for BDI agents mostly in form of modules called capabilities.
The newest version!
package jadex.bdi.planlib.messaging;
import java.io.IOException;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.URLName;
/**
* Test class for java mail API.
*/
public class MailTest
{
/**
* Main method for testing.
* @throws IOException
*/
public static void main(String[] args) throws MessagingException, IOException
{
Session session = Session.getDefaultInstance(System.getProperties());
URLName url = new URLName("pop3", "localhost", 110, "", "[email protected]", "test");
Store store = session.getStore(url);
store.connect();
Folder inbox = store.getFolder("INBOX");
inbox.open(Folder.READ_ONLY);
if(inbox.getMessageCount()>0)
{
for(int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy