0

I am trying to create an email client but I am unable to connect to pop3 server. I used following links to send email:

http://java.sun.com/developer/onlineTraining/JavaMail/contents.html

http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_%28no_Intents%29_in_Android

Sending Email in Android using JavaMail API without using the default/built-in app

I send emails from both emulator and real device.Now, I am trying to connect to pop3 server to read messages with following properties:

    props.setProperty("mail.transport.protocol", "pop3");   
    props.setProperty("mail.host", server);   
    props.put("mail.pop3.auth", "true");  // smtp authentication - default on  
    props.put("mail.pop3.port", "110");   
    props.put("mail.pop3.socketFactory.port", "110");   
    props.put("mail.pop3.socketFactory.class",   
            "javax.net.ssl.SSLSocketFactory");   
    props.put("mail.pop3.socketFactory.fallback", "false");   
    props.setProperty("mail.pop3.quitwait", "false");   
    props.put("mail.debug", "true"); // debug mode on or off - default off 

    session = Session.getDefaultInstance(props, this);  

But application fails to connect to the server. I am attaching logCat which shows that it fails to load javamail.providers then it loads default providers. Then it fails to load javamail.address, tries to connect to pop3.gmail.com but fails to connect.

I'm new to android, can any one guide me?

logCat_Image1remaining part of image1

halfer
  • 19,824
  • 17
  • 99
  • 186
blackfyre
  • 2,549
  • 5
  • 39
  • 58
  • Possible duplicate of [how to synchronize application email to server email using java mail in android](https://stackoverflow.com/questions/9953252/how-to-synchronize-application-email-to-server-email-using-java-mail-in-android) – halfer Mar 02 '19 at 19:22

1 Answers1

0

Problem is solved, my properties were incorrect. Got help from following link

how to synchronize application email to server email using java mail in android

Community
  • 1
  • 1
blackfyre
  • 2,549
  • 5
  • 39
  • 58
  • Also be sure to read this [JavaMail FAQ entry](http://www.oracle.com/technetwork/java/javamail/faq/index.html#commonmistakes) for some other issues with your code. – Bill Shannon Jul 26 '12 at 16:42