Discussions

EJB design: Want to comunicate with POP3 server

  1. Want to comunicate with POP3 server (7 messages)

    Hi

       I want to comunicate with POP3 server. In POP3 server
    I want to retrive emailid(from,and to),subject,message and
    store it in the Oracle database.
    Could u give me the details and about POP3 protocal server?.


    -irapy

    Threaded Messages (7)

  2. Want to comunicate with POP3 server[ Go to top ]

    Hi!

    You can look at:
    http://java.sun.com/products/javamail

    You'll find the implementation for Java Mail in that site.

    Hope this helps.
    Lofi.
  3. Want to comunicate with POP3 server[ Go to top ]

    Hi
    Can i get source code for this
  4. Want to comunicate with POP3 server[ Go to top ]

    Hi
     
    I want to get the message from POP3 server.

    The program which I used is


    //It retrives the messages from POP3 server


    import javax.mail.*;
    import javax.mail.internet.*;

    public class GetMessageFromPOP3 {
      public static void main (String args[])
          throws Exception {
        String host = args[0];
        String username = args[1];
        String password = args[2];

        // Get session
        Session session = Session.getInstance(
          System.getProperties(), null);

        // Get the store
        Store store = session.getStore("pop3");
        store.connect(host,110, username, password);

        // With out port no

        //store.connect(host,username, password);

        // Get folder
        Folder folder = store.getFolder("INBOX");
        folder.open(Folder.READ_ONLY);

        // Get directory
        Message message[] = folder.getMessages();
        for (int i=0, n=message.length; i<n; i++) {
           System.out.println(i + ": "
             + message[i].getFrom()[0]
             + "\t" + message[i].getSubject());
        }

        // Close connection
        folder.close(false);
        store.close();
      }
    }

    But it Gives Error:
    C:\javamailcollections>java GetMessageFromPOP3 mail.bigthings.com irapy xyz
    Exception in thread "main" javax.mail.NoSuchProviderException: No provider for p
    op3
            at javax.mail.Session.getProvider(Session.java:249)
            at javax.mail.Session.getStore(Session.java:323)
            at javax.mail.Session.getStore(Session.java:303)
            at GetMessageFromPOP3.main(GetMessageFromPOP3.java, Compiled Code)

    So what should i give in the place of host.
    please give me more details about the POP3 Servers.

    -irapy
  5. Want to comunicate with POP3 server[ Go to top ]

    Hi!

    Protocol: pop3
    Server: for example pop.mail.yahoo.com

    There is a good examples with the JavaMail
    (at the \demo folder). I think, it would
    help you in this case.

    Lofi.
  6. Want to comunicate with POP3 server[ Go to top ]

    The POP3 provider is not part of the standard JavaMail download. You'll have to download the pop3.jar seperatly and include it in your classpath. I'm pretty sure you can grab it from the java.sun.com site with the other java mail downloads.

    Cheers,

    Gavin.
  7. Want to comunicate with POP3 server[ Go to top ]

    Hello,

       Java Beans Avtivation Frame work API will take care about the security restrictions. So, download it and make a class path for that.

       Subjects, Messages, To and Fro addresses any way you will get it thru pop3 protocol. So, you can easily store it on Oracle database. by establishing the jdbc connection.

    regards,
    Narasimha.
     
  8. Want to comunicate with POP3 server[ Go to top ]

    Hello,

       Java Beans Avtivation Frame work API will take care about the security restrictions. So, download it and make a class path for that.

       Subjects, Messages, To and Fro addresses any way you will get it thru pop3 protocol. So, you can easily store it on Oracle database. by establishing the jdbc connection.

    I will try here and send the source code within a day.


    regards,
    Narasimha.