Package javax.mail

Examples of javax.mail.Folder.open()


    HeadersHelper oHlpr = new HeadersHelper();
    String [] aMsgsXml = null;

    Folder oFldr = getFolder(sFolderName);

  oFldr.open (Folder.READ_ONLY);

  int iDeleted = 0;
  int iTotalCount = oFldr.getMessageCount();

  if (iTotalCount>0) {
View Full Code Here


    HeadersHelper oHlpr = new HeadersHelper();
    String [] aMsgsXml = null;

    Folder oFldr = getFolder(sFolderName);

  oFldr.open (Folder.READ_ONLY);

  int iTotalCount = oFldr.getMessageCount();

    if (DebugFile.trace) DebugFile.writeln(String.valueOf(iTotalCount)+" messages found at "+sFolderName);
View Full Code Here

            System.exit(1);
         }

         // try to open read/write and if that fails try read-only
         try {
            folder.open(Folder.READ_WRITE);
         } catch (MessagingException ex) {
            folder.open(Folder.READ_ONLY);
         }
         int totalMessages = folder.getMessageCount();
View Full Code Here

         // try to open read/write and if that fails try read-only
         try {
            folder.open(Folder.READ_WRITE);
         } catch (MessagingException ex) {
            folder.open(Folder.READ_ONLY);
         }
         int totalMessages = folder.getMessageCount();

         if (totalMessages == 0) {
            System.out.println("Empty folder");
View Full Code Here

            //if it's inbox
            folder = folder.getFolder("INBOX");
            if (folder == null) {
                return false;
            }
            folder.open(Folder.READ_ONLY);
            //get mail list
            Message[] msgs = folder.getMessages();
            Progress.switchToDeterminate(progress, msgs.length);
            Progress.setDisplayName(progress, "Download "+msgs.length+" emails");
            //show progress bar
View Full Code Here

        Mailbox.clearAll();
        JavaMailSender sender = new DefaultJavaMailSender();
        Store store = sender.getSession().getStore("pop3");
        store.connect("localhost", 25, "bill", "secret");
        Folder folder = store.getFolder("INBOX");
        folder.open(Folder.READ_WRITE);
        folder.expunge();

        // inserts 1 new message
        Message[] messages = new Message[1];
        messages[0] = new MimeMessage(sender.getSession());
View Full Code Here

        Mailbox.clearAll();
        JavaMailSender sender = new DefaultJavaMailSender();
        Store store = sender.getSession().getStore("pop3");
        store.connect("localhost", 25, "bill", "secret");
        Folder folder = store.getFolder("INBOX");
        folder.open(Folder.READ_WRITE);
        folder.expunge();

        // inserts 3 messages, one with earlier, one with later sent date and one with invalid subject (not returned in search)
        Message[] messages = new Message[3];
        messages[0] = new MimeMessage(sender.getSession());
View Full Code Here

        Mailbox.clearAll();
        JavaMailSenderImpl sender = new JavaMailSenderImpl();
        Store store = sender.getSession().getStore("pop3");
        store.connect("localhost", 25, "bill", "secret");
        Folder folder = store.getFolder("INBOX");
        folder.open(Folder.READ_WRITE);
        folder.expunge();

        // inserts 5 new messages
        Message[] messages = new Message[5];
        for (int i = 0; i < 5; i++) {
View Full Code Here

        Mailbox.clearAll();
        JavaMailSenderImpl sender = new JavaMailSenderImpl();
        Store store = sender.getSession().getStore("imap");
        store.connect("localhost", 25, "claus", "secret");
        Folder folder = store.getFolder("INBOX");
        folder.open(Folder.READ_WRITE);
        folder.expunge();

        // inserts two messages with the SEEN flag
        Message[] msg = new Message[2];
        msg[0] = new MimeMessage(sender.getSession());
View Full Code Here

        Mailbox.clearAll();
        JavaMailSenderImpl sender = new JavaMailSenderImpl();
        Store store = sender.getSession().getStore("pop3");
        store.connect("localhost", 25, "jones", "secret");
        Folder folder = store.getFolder("INBOX");
        folder.open(Folder.READ_WRITE);
        folder.expunge();

        // inserts 5 new messages
        Message[] messages = new Message[5];
        for (int i = 0; i < 5; i++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.