Results 1 to 3 of 3
  1. #1
    nyk976 is offline Member
    Join Date
    Jan 2010
    Posts
    5
    Rep Power
    0

    Default error in connecting to gmail server

    hi guys,

    i am having problem in connecting to gmail server by using java.
    the error its giving is "javax.mail.MessagingException: Connect failed;
    nested exception is:
    java.net.UnknownHostException: pop.gmail.com"

    is this error is due to wireless connection through my laptop or something else? i am using netbeans for my environment, i have also added the javamail api for the same! stil i am getting the error!!

    please help!!:(

  2. #2
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    364
    Rep Power
    5

    Default gmail pop

    Settings:

    Incoming Mail (POP3) Server - requires SSL: pop.gmail.com
    Use SSL: Yes
    Port: 995
    ---


    This command has to work from command line :

    telnet pop.gmail.com 995

    ...If not somethings not OK with your network

    TIP:
    You have to manually enable telnet on VIsta or Windows 7.
    ---

    Here is example that works fine:

    Java Tips - Connecting GMail using POP3 connection with SSL

    TIP:
    If code is not working well
    go to method
    printAllMessages()
    and put comment on FetchProfile:


    Java Code:
    /*
    		// Use a suitable FetchProfile
    		FetchProfile fp = new FetchProfile();
    		fp.add(FetchProfile.Item.ENVELOPE);        
    		folder.fetch(msgs, fp);
    	*/
    ...Now when you run code
    it should list all of your INBOX messages.


    Be sure that your gmail account is set properly.

    So login to your gmail account first
    and then click this link:

    http://mail.google.com/mail/?shva=1#settings/fwdandpop

    ...it will lead you directly to your account Settings for POP.

    If everything is set fine you will find no problem.

    Any other problem related to JAVA MAIL API,
    go to "JAVA MAIL API FAQ" and you will find it all there.

    regards!

  3. #3
    nyk976 is offline Member
    Join Date
    Jan 2010
    Posts
    5
    Rep Power
    0

    Lightbulb gmail connectivity

    hey thanks for the help!!
    i didnt saw the link u provided the same (java tips)!
    it wil really help me.

    thank you.:)

Similar Threads

  1. error in smpt.gmail.com host
    By kib_tse in forum Networking
    Replies: 15
    Last Post: 03-10-2011, 06:25 PM
  2. connecting to a server
    By paddala in forum Advanced Java
    Replies: 4
    Last Post: 02-16-2010, 07:40 PM
  3. Connecting to SQL Server 2008 DB
    By Lyle in forum Eclipse
    Replies: 1
    Last Post: 02-22-2009, 04:26 PM
  4. Connecting To SQL Server
    By rmaadil in forum JDBC
    Replies: 7
    Last Post: 08-20-2008, 05:53 PM
  5. Connecting to a Web server
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-07-2008, 07:57 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
  •