Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6849767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:02:10+00:00 2026-05-27T01:02:10+00:00

I have been working at home on Gmail-Imap-Api on the weekend. It was working

  • 0

I have been working at home on Gmail-Imap-Api on the weekend. It was working Properly But when i returned to office and am trying here it throws exception.

    Properties props = System.getProperties();
    props.put("mail.store.protocol", "imaps");
    props.put("mail.smtp.auth", "true");

    try {
        boolean debug = false;
        Authenticator auth = new SMTPAuthenticator(
                "***", "***");

        Session session = Session.getInstance(props, auth);
        session.setDebug(debug);
        Store store = session.getStore("imaps");
        store.connect("imap.gmail.com", "***@gmail.com",
                "****");
    ......
    ......

This was working fine at home netwrok.
Now i thought i would add proxy and added these lines of code.

    System.setProperty("http.proxyHost", "****.com");
    System.setProperty("http.proxyPort", "8080");

Still it doesnt work and the exception is.

com.google.code.javax.mail.MessagingException: imap.gmail.com;
nested exception is:
java.net.UnknownHostException: imap.gmail.com
at com.google.code.com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:665)
at com.google.code.javax.mail.Service.connect(Service.java:295)
at com.google.code.javax.mail.Service.connect(Service.java:176)
at openReports.OpenReportsProject.main(OpenReportsProject.java:43)
Caused by: java.net.UnknownHostException: imap.gmail.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:367)
at java.net.Socket.connect(Socket.java:524)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:545)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141)
at com.google.code.com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:288)
at com.google.code.com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231)
at com.google.code.com.sun.mail.iap.Protocol.<init>(Protocol.java:113)
at com.google.code.com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:110)
at com.google.code.com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:632)
... 3 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:02:11+00:00Added an answer on May 27, 2026 at 1:02 am

    The proxy settings that you have entered will work only for HTTP connections. IMAP is a different protocol operating on a different port (993 in this case). If you are behind firewall, your firewall needs to allow connection to the external host:port AND the protocol. You need to request to your Network Administrator for this. Once the settings are in place you will be able to communicate to Gmail Imap server on default/specified port with specified protocol.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying for several hours now to get sorl-thumbnail working, but it
been working on an app and have been studying the questions available here but
I have been working on a Timesheet Management website. I have my home page
I have been working on this problem for a while but still no joy.
I have been working with rails3 , here the view.html.erb form have one login
I have been trying to get xapian working django haystack for a project im
I have been working all day but unable to achieve this : It is
I've been working on a home project using CodeIgniter Reactor, and have come to
I have been trying to get a 2-way ssl/https proxy working with Camel. I
I have an MVC app that I have been working on but I seem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.