Read mails in order of priority

Hi all,
I have a program that polls a folder for in comming messages. How would I pick up in the order of priority messages before other normal messages. any suggestions ? thanx

Read the unprocessed messages into some kind of a collection. Sort that collection in decreasing priority order and handle the messages in that order.

Similar Messages

  • Custom  order of priority queue

    I am a novice in Java. I intend to use a priority queue which holds objects. The objects have a string and two integers. I have to order the priority queue based on one of the integer.
    I write syntax according to my understanding please correct me.
    PriorityQueue<Object> pr = new PriorityQueue<Object>();
    comparable(){
    sort(Object.int2)// this is the place where I am confused
    }

    Here's an example:
    public class Caller
        public static void main(String[] args)
            Flight f1 = new Flight( "java", 2, 34 );
            Flight f2 = new Flight( "java", 2, 3 );
            Flight f3 = new Flight( "java", 2, 4 );
            Flight f4 = new Flight( "java", 2, 64 );
            Flight f5 = new Flight( "java", 2, 22 );
            Flight f6 = new Flight( "java", 2, 12 );
            PriorityQueue pq = new PriorityQueue();
            pq.add(f1);
            pq.add(f2);
            pq.add(f3);
            pq.add(f4);
            pq.add(f5);
            pq.add(f6);
            System.out.println(pq.poll());
            System.out.println(pq.poll());
            System.out.println(pq.poll());
            System.out.println(pq.poll());
            System.out.println(pq.poll());
            System.out.println(pq.poll());
    public class Flight implements Comparable
        private String airlinename;
        private int flightnumber;
        private int number;
        public int compareTo(Object o)
            Flight f = (Flight) o;
            return number - f.getNumber();
        public String toString()
            return airlinename + " - " + number;
        public Flight(String airname, int num1, int num2)
            airlinename = airname;
            flightnumber = num1;
            number = num2;
        public String getAirlinename()
            return airlinename;
        public void setAirlinename(String airlinename)
            this.airlinename = airlinename;
        public int getFlightnumber()
            return flightnumber;
        public void setFlightnumber(int flightnumber)
            this.flightnumber = flightnumber;
        public int getNumber()
            return number;
        public void setNumber(int number)
            this.number = number;
    }Got it?

  • TS1424 cannot get verification sent too my e-mail in order too set up accounnt

    cannot get verification sent too my e-mail in order too set up account

    han_solo wrote:
    I think we just have to be patient as Apple has just rolled this out. I'm having trouble too. Their servers may just be slow right now.
    I'm not complaining that the servers didn't send an e-mail immediately when I entered the addressed. When I requested an re-send, those were sent immediately to both of my additional e-mail addresses.
    This is not a matter of the servers being slow. It's a case where the e-mail addresses have already been verified by Apple's e-mail system and it's not sending out another verification request because there is no need. It needs to be fixed in, hopefully, what will be on the server end and it will automatically verify the address attached to your iTunes account because it has already been verified.
    I did take the extra step and remove my e-mail address that is my iTunes account address and then re-added it again as an additional e-mail address (since it is automatically added under the e-mail sharing section if it is enabled). It still would not send me an e-mail for verification or show that it is already verified. Apple needs to see that this is a problem and I'm just wondering what is the best way to bring it to their attention. It's not a show-stopper, but when people are trying to be located, it will make things more difficult if the person who is looking uses that person's iTunes account e-mail address because it will never be verified in Game Center the way it is now.
    Like I said, I hope this is an issue that can be resolved on the server-side and not require an update to the app which will take more time to happen. It's not the end of the world, but it's a nuisance and should have been caught because it's quite obvious. It's possible that they didn't do e-mail verification prior to the gold release since they were going to reset the whole database before iOS 4.1 went live today.
    What's the best way to bring this to Apple's attention so it can be resolved? It's clearly a problem that I think all users are having.

  • Hi, I purchased Acrobat Standard XI and received a mail thatthe order has been processed. Installation was fine, but I didn't receive the serial number.

    Hi, I purchased Acrobat Standard XI and received a mail thatthe order has been processed. Installation was fine, but I didn't receive the serial number.

    If you purchased a subscription, there is no serial number. Sign in with your Adobe ID to license the software.

  • Hi, my friend. Has a problem psychologically Atabtna It is  Lost e-savior to change the security question has been the savior of new mail in order to put that I could answer the question of safety  But I did not activate the new Alamil hope to solve

    Hi, my friend.
    Has a problem psychologically Atabtna
    It is
    Lost e-savior to change the security question has been the savior of new mail in order to put that I could answer the question of safety
    But I did not activate the new Alamil hope to solve these are the problem

    Resolving this issue requires asking Apple to reset the security questions. To do so, click here and pick a method; if that page doesn't list one for the country or the person is unable to call, fill out and submit this form.
    (124711)

  • How can I read email from my aol account from my iphone and keep it as uread on my computer at home.  It automatically goes to read mail on my computer.  On my computer if I want to keep an email to answer later I can mark it "Keep as New".

    How can I read my email from my aol account from my iphone and keep it as "unread" on my computer at home?  At home I can read an email and if I want to get back to it at a later date I can mark it as "keep as new".  I tend to forget it if it goes to "read" mail.   Right now, when I read an email from my phone it goes automatically to "read" mail.

    On the iPad, using the mail app, there is no way to do what you are asking without tapping the flag icon and marking the item as unread. Have you tried the OWA app for the iPad? It may have that functionality, but I haven't tested it as you need an Office 365 subscription with Exchange support to use the app.

  • Confirmation of reading mail in mac mail//Confirmacao de leitura no mail mac mail

    Confirmation of reading mail in mac mail
    Confirmacao de leitura de mail no mac mail
    How?
    Como?

    No.
    Não.

  • ME23N - Read Last Purchase Order for Display

    Hi,
    We are upgrading from 4.6C to ECC6 and one of the problems the users have identified is that when displaying the purchase order with transactions ME22N or ME23N the last purchase order that was worked on is not always the one that is displayed.
    This is very evident when creating a PO with ME21N and then switching to view it on ME23N - in ECC6 the PO that was created is never the PO that is displayed on ME23N; whereas in 4.6C creating a PO with ME21N and switching to ME23N the PO that was created is ALWAYS the PO that is displayed on ME23N.
    It this feature (whatever) no longer available with ECC6?  Is it a configuration settings that we haven't properly set in ECC6? 
    Thanks for any help.
    Martha

    I analysed how SAP remembers the previous purchase order number in transaction ME23N in version 4.7 as I do not have access to version ECC6. In version 4.7 transaction ME23N reads table ESDUS (MM: Dynamic User Settings) in the following way
    ESDUS-UNAME = sy-uname
    ESDUS-ACTION = 'MEPO'
    ESDUS-ELEMENT = 'Application         Po_Process'
    The purchase order number is the first 10 characters of ESDUS-ACTIVE (ESDUS-ACTIVE+0(10)).
    When you read a new purchase order SAP writes that order number to table ESDUS using function module ES_SAVE_USER_SETTINGS. When you revisit the transaction SAP uses function module ES_READ_USER_SETTINGS to read the purchase order number stored in table ESDUS.
    Ask an ABAP programmer to investigate this in your system with the information I have provided you. He/She should be able to find out what is going wrong. I am limited because I do not have access to your system. Hope this helps. Please let me know what the ABAP programmer found out.

  • Problem in Reading Mail Attachement

    I'm facing a problem while reading mail attachments. Java-mail returns null disposition for the below message,but this message has attachment javamail is not considering the mail attachment .I'm using java-mail 1.3.Can anybody help me to solve this problem ?
    Return-Path: prvs=00548bd8bd=[email protected]
    Received: from PRODTM1.TRUST.UASC.AO ([172.28.2.143])
         by trust.uasc.net
         ; Mon, 14 Mar 2011 11:07:04 +0000
    X-TM-IMSS-Message-ID:<[email protected]>
    Received: from gw.northport.com.my ([202.188.31.130]) by trust.uasc.net ([172.28.2.144])
    with ESMTP (TREND IMSS SMTP Service 7.1) id 45727fb90003495a ; Mon, 14 Mar 2011 11:06:52 +0000
    Received: from [192.1.10.13] (port=59768 helo=nmbsmtp-01.northport.com.my)
         by gw.northport.com.my with esmtp (Exim 4.69)
         (envelope-from <[email protected]>)
         id 1Pz5bs-0003EO-0A; Mon, 14 Mar 2011 19:06:48 +0800
    X-CTCH-RefID: str=0001.0A090205.4D7DF6C8.0116,ss=1,fgs=0
    Date: Mon, 14 Mar 2011 19:05:50 +0800 (SST)
    From: AMTedi-Container Svcs <[email protected]>
    Message-ID: <[email protected]>
    Mime-Version: 1.0
    To: [email protected], [email protected],
    [email protected], [email protected]
    Subject: CODCT1UAS
    Content-Type: multipart/mixed; boundary="-"
    X-TM-AS-Product-Ver: IMSS-7.1.0.1394-6.5.0.1024-18010.003
    X-TM-AS-Result: No--4.942-5.0-31-1
    X-imss-scan-details: No--4.942-5.0-31-1

    If you were assuming that every message would have a valid body part
    and that they would tell you definitively which parts you should consider to
    be "attachments", ya, that won't work. The disposition is a hint at best.
    It can be wrong. It might not even be there.

  • Reading mails from Hmail Server

    hi all,
    I am using an java mail api to read mails from a hmail server.I was successfull in reading mails and analysing it further but the problem that i face is my program could read only the recent mails ,all the remaining unread mails were not accessible from the java code.......i am attaching my code...
    package mail.hmailserver;
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    public class ReadMail_frm_hmailserver {
         int c=0;
    @SuppressWarnings("unchecked")
    public static void main(String args[]) throws Exception {
    ReadMail_frm_hmailserver mailObj=new ReadMail_frm_hmailserver();
    mailObj.readMails();
    public Vector[] readMails() throws Exception
         String host = "172.29.19.78";
    String user = "[email protected]";
    String password = "testuser1";
    // Get system properties
    Properties properties = System.getProperties();
    // Get the default Session object.
    Session session = Session.getDefaultInstance(properties,null);
    // Get a Store object that implements the specified protocol.
    Store store = session.getStore("pop3");
    //Connect to the current host using the specified username and password.
    store.connect(host, user, password);
    //Create a Folder object corresponding to the given name.
    Folder folder = store.getFolder("inbox");
    // Open the Folder.
    folder.open(Folder.READ_ONLY);
    //folder.open(Folder.READ_WRITE);
    Message[] message = folder.getMessages();
    // String [] contents=new String[10];
    Vector [] contents = new Vector[message.length];//creating array of vectors to store mails
    // Vector contents1=new Vector();
    System.out.println("No of mails : " + message.length);
    System.out.println("subject 1 : "+message[0].getSentDate());
    System.out.println("subject 2 : "+message[0].getSubject());
    // System.out.println("subject 3 : "+message[2].getSubject());
    // System.out.println("subject 4 : "+message[3].getSubject());
    //System.out.println("-----------------");
    // Display message.
    for (int i = 0; i < message.length; i++) {
              c=0;
              contents[i] = new Vector(); //since vector array is an array of arrays we hav to initilize each of the content vectors
    System.out.println("------------ Message " + (i + 1) + " ------------");
    System.out.println("SentDate : " + message.getSentDate());
    System.out.println("From : " + message[i].getFrom()[0]);
    System.out.println("Subject : " + message[i].getSubject());
    System.out.print("Message : ");
    //System.out.println(message[i].getContent());
    Multipart multipart = (Multipart) message[i].getContent();
    //System.out.println(multipart.getCount());
    String line = null;
    for (int j = 0; j < multipart.getCount(); j++) {
    //System.out.println(i);
    //System.out.println(multipart.getContentType());
    BodyPart bodyPart = multipart.getBodyPart(j);
    InputStream stream = bodyPart.getInputStream();
    BufferedReader br = new BufferedReader(new InputStreamReader(stream));
    while (br.ready()) {         
         try {
                                  //line.append(br.readLine());
              //line=line+"\n"+br.readLine();
              line=br.readLine();
              if(line.equals("NOTICE")){
                        System.out.println("entered-----------------------------exit loop");
                        //exit();
                        c++;
                        break;
              if(c==0)
              contents[i].add(line); //adding the mails line by line to the array
                             System.out.println(line);
              //System.out.println(contents[i].get(j));
         } catch (Exception e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
                                  System.out.println("Exception : "+e);
         //contents[1].add(line);
    System.out.println();
    //System.out.println(line);
    // contents[i].add(line); //adding the mails line by line to the array
    System.out.println();
    // folder.close(true);
    //store.close();
    //System.out.println(contents.length);
    //System.out.println(contents[0].get(0));
    //System.out.println(contents[0].);
    return contents;

    You might want to use IMAP to read mail from hMail Server, if you keep messages on server. It has a lot more features for managing messages on server.
    A lot of POP3 implementations (both client and server side) will automatically delete retrieved messages. I don't know exactly what JavaMail does in that regard, nor of hMailServer, but I do know some mailservers out in the wild will ALWAYS delete mails retrieved with POP3.

  • Hi!! how can i read mails present in the sub folder from outlook inbox

    hi every one...
    i have to read a sub folder present in the inbox from outlook.
    for that i tried as
    Session session = Session.getDefaultInstance(props, null);
    store = session.getStore("pop3");
    store.connect("URL", "USERNAME","PASSWORD");
    inbox = store.getFolder("INBOX/subFolderName");but it shows an error like Folder Not Exist...
    can any one suggest me to solve this problem to read mails present in the sub folder.
    Thank you

    thank you for support guys...
    so if i am using pop3 protocal, it cant read the sub folders present in the outlook inbox ..
    is there any alternative way to achieve this ...?

  • How to send a Mail purchase order automaticaly from ME22N

    How to send a Mail purchase order automaticaly from ME22N

    Hi,
    First create an entry via NACE with medium =   5 ( External send ) with all other details same as normal print option. Now ensure that vendor master of the po has got the external e-mail id of the vendor. Now go to ME22n in mesages create a message with medium = 5 ( External Send ). Go to communication method, key in Communication strategy.Go to Further date & against Despatch time pick up option 4 viz. Send immeidately while saving an application. Now once you press the save button it will be sent to the address maintained in the vendor master of the vendor of the PO. Please note you require some basic settings from BASIS side as well.
    I hope this helps,
    You may also refer to the SAP note 191470.
    Regards
    Raju Chitale

  • HT6030 I have many problems with my mail since I moved to mavericks. The filter is very sensitive, read mail appears as unread, I can't drag mail to the folders and more. I can't update the mail program as directed on this page, update says my system is u

    I have many problems with my mail since I moved to mavericks. The filter is very sensitive, read mail appears as unread, I can't drag mail to the folders and more. I can't update the mail program as directed on this page, update says my system is updated

    I don't think that a software update from Apple will solve the issues that you are having. You have a rogue installation. After you posted I have just done the following:
    Disk Utility can verify  my partitioned Volume (including my boot disk) AND REPAIR the non-boot disks on the same Volume without a glitch. It repairs the non-boot disks containing data smoothly.
    I have used Mail to send some mails from some Yahoo and Hotmail accounts to my Thunderbird client containing GMail accounts - absolutely normal.
    I have iLife '09 but my iMovie '09 and iPhoto '09 open in a jiffy and I see no issues here. I have 6GB RAM (Maximum) on an early 2008 Macbook Pro with a 750GB hard drive partitioned with 120GB reserved for the Boot Drive.
    I am sorry that I cannot help further but I am sure there must be a way to reinstall the software without having to revert to restoring your ML backup. I have two clones and if you have such I would attempt to do that through that rather than through Time Machine - that is of course if you have a cloned drive.
    Good luck!

  • Missing "Read Mail" Folder

    I had trouble with my Mac yesterday and lost all application preferences. I used to have a "Read Mail" file set up within mail where I would move messages I wished to keep. Is there a data file that was storing these messages? If so, how can I restore or reopen this file?
    Power Mac G4, 867 MHz   Mac OS X (10.4.7)  

    Does such a power outage or spikes occur very often in your area?
    If so, you should consider investing in a UPS (uninterrupted power supply) which I would do with a Desktop regardless.
    In addition, nothing is better protection than maintaining a regular backup and preferably a bootable clone backup saved to an external firewire drive.
    That being said, when you first launched Mail after the power outage and were prompted to re-enter all account information, were you also prompted to import any mailboxes?
    All Mail.app data is stored in the Mail folder at Home > Library > Mail. All user created "On My Mac" location mailboxes, locally stored mailboxes for a .Mac or IMAP type account, any imported mailboxes and the Outbox mailbox which is shared by all accounts are located in the Mailboxes folder at Home > Library > Mail > Mailboxes.
    Check if this Read Mail mailbox is available. It should be a Read Mail.mbox named folder.

  • Error while while reading mails

    Hi,
    I'm getting the following error while I'm trying to read mails from server where POP3 is enabled. Could anyone please let me know how I can fix it?
    Exception in thread "main" javax.mail.AuthenticationFailedException: The request
    ed mailbox is not available on this server.
    at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:159)
    at javax.mail.Service.connect(Service.java:288)
    at javax.mail.Service.connect(Service.java:169)
    at GetMessageExample.main(GetMessageExample.java:26)
    Regards,
    Abdul

    I think you may got this error due to one of the following
    There should be a problem with the host or mail server
    Your mail server requires authentication
    your authentication may fail

Maybe you are looking for

  • Cannot creat PR

    This is Naresh, new to SAP-MM. Iam getting an error while creating PR. The error is "Enter rate EUR/INR rate type M for 3:01:2009 in the system settings". Please anyone clarify my error.

  • Increase root filesystem size with VxVM

    Hi All, Can i increase the root fileystem size in solaris 10 after encapsulating the root disk into VxVM. Thanks ---MGP---

  • White screen upon booting

    Hi I need some help my macbook pro 15" (os lion dont know what version) went to sleep and ran out of battery, when i charged it and tried to start up it wouldn't so i did a force shutdown (press power for 10 secs), now when i reload it loads the bar

  • Just wanted to say thanks to Pierre

    Hi all, I haven't posted in ages, but I wanted to say thanks to Pierre for doing such a great job of packaging kde4.4.  I'm one of those annoying hold-outs who was still clinging to kde3, but the number of things that weren't functioning on my system

  • Safari has been deleted

    Now, first of all I want to make it perfectly clear that I didn't do this. My friend did this. She deleted Safari. Yes, it's completely deleted. What do we do to get Safari back on her macbook pro? It's a little too big to send as an email attachment