Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2010
    Location
    Bangalore
    Posts
    7
    Rep Power
    0

    Post J2ME POP3 connection code for INBOX

    hi Please help me
    I am trying to connect POP3 server to retrive mails form INBOX and shown in mobile screen(J2ME)

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    as far as I know, there isn't a java mail api for J2ME?

    Would it be possible to have the mobile client connect thru a kind of middleware / proxy server. where your application does (your own custom RPC) mechanism to invoke the pop connector operation from this middleware / proxy server, which connects to the POP mailbox, and fetches the message headers, or the contents itself, and returns the stuff to be shown for the current screen back to the mobile client.
    This might be better for bandwidth, and in general asychronous performance (e.g. the midldeware could invoke periodic check for new mail in the mail box more frequently than would be convenient to do from a mobile device due to batter conservation issues). But primarily, to take advantage of the java mail api that is available in the standard J2SE

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  4. #4
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    first you must create a socket here is an example :
    StreamConnection con =(StreamConnection)Connector.open("socket://pop3.gawab.com:110);
    InputStream in = con.openInputStream();
    OutputStream out = con.openOutputStream();
    out.write("user YOUR_USER_NAME");
    out.flush();
    int c;
    while((c=in.read())!=-1){
    System.out.println((char)c);
    }
    out.write("pass YOUR_PASSWORD");
    out.flush();
    while((c=in.read())!=-1){
    System.out.println((char)c);
    }
    out.write("list");
    out.flush();
    //...

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. j2me code
    By manojp476 in forum CLDC and MIDP
    Replies: 3
    Last Post: 05-11-2010, 05:38 PM
  2. Need tic tac toe code in j2me
    By pacific112j in forum CLDC and MIDP
    Replies: 1
    Last Post: 01-22-2010, 11:08 PM
  3. Need tic tac toe code in j2me
    By pacific112j in forum New To Java
    Replies: 2
    Last Post: 01-22-2010, 11:08 PM
  4. Replies: 1
    Last Post: 08-07-2009, 10:30 AM
  5. sending mails thru pop3 server.........
    By vrk in forum Advanced Java
    Replies: 1
    Last Post: 03-25-2009, 11:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •