Saturday 15 September 2012

could not retrieve mail on android using javamail -


I have retrieved the mail via javamail for a code, but it does not successfully fetch the mail, but there is no error With the same code, can anyone help me recover the mail with the Netbeen IDE?

My work: readMail.java


Provides mail authentication read public class {

  private string tool; Public message [] getReadMail () throws MessagingException {string; SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; String Username = "someuser@gmail.com"; String password = "some password"; Properties pop3Props = new property (); Pop3Props.setProperty ("mail.pop3.socketFactory.class", SSL_FACTORY); Pop3Props.setProperty ("mail.pop3.socketFactory.fallback", "wrong"); Pop3Props.setProperty ("mail.pop3.port", "995"); Pop3Props.setProperty ("mail.pop3.socketFactory.port", "995"); URL name url = New URL ("pop3", "pop gmail dot com", 995, "", username, password); Session session = session .get instances (pop3 profiles, blank); Store store = new POP3SSLStore (session, url); Store.connect (); Folder inbox = store.getFolder ("INBOX"); Inbox.open (Folder.READ_ONLY); Message [] message = inbox.getMessages (); Return message; } Public Zero SetSubject (String Subject) {this.subjek = subjek; } Public string becomes available () {Return subjek; }   

}


My activity: main activity. Java


  @ override protected zero creation ( Bundle Saved InstantStat) {TextView subjek = (TextView) findViewById (R.id.subjek); Super.onCreate (savedInstanceState); SetContentView (R.layout.activity_main); Try {readMail readmail = new readMail (); Message [] message = new message [] {}; Message = readmail.getReadMail (); {Subjek.setText (Message [1] .getSubject ()) for (Int i = 0; I & lt; 10; i ++); }} Catch (Messaging Expression E) {Toast. Make Text (this, "Server of Goggle Conceasee", Toast. LNNHHLANG). Show (); }} @ Override Public Boolean On Crate Option Menu (Menu Menu) {// Increase Menu; It adds the item to the Action Bar if it exists GetMenuInflater (). Fluo (R. menu menu, menu); Back true; }   

}

To get started, see.

Besides, you can.

And you want to see them.

No comments:

Post a Comment