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 6079131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:54:42+00:00 2026-05-23T10:54:42+00:00

I am using code from on the earlier threads(have pasted the code below as

  • 0

I am using code from on the earlier threads(have pasted the code below as well):

Getting mail from GMail into Java application using IMAP

How do I make this code work if I am behind a proxy?

The connection is getting timed out, I have tried to search for a solution but to no avail.

public static void main(String args[]) {

    Properties props = System.getProperties();
    props.setProperty("mail.store.protocol", "imaps");
        try {
            Session session = Session.getDefaultInstance(props, null);
            Store store = session.getStore("imaps");
            store.connect("imap.gmail.com", email, password);
            System.out.println(store);

            Folder inbox = store.getFolder("Inbox");
            inbox.open(Folder.READ_ONLY);
            Message messages[] = inbox.getMessages();
            for(Message message:messages) {
            System.out.println(message);
        }
    } catch (NoSuchProviderException e) {
        e.printStackTrace();
        System.exit(1);
    } catch (MessagingException e) {
        e.printStackTrace();
        System.exit(2);
    }

}

Thanks,
Chris.

  • 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-23T10:54:43+00:00Added an answer on May 23, 2026 at 10:54 am

    Behind the proxy doesn’t stop you to connect to IMAP

    There could be 2 reasons

    1. The IMAP port is block by your network administrator
    2. your IP is blocked/banned by Google

    Thanks

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

Sidebar

Related Questions

I'm using this code from Microsoft to play audio notifications for my application. It's
Using the code below (from a console app I've cobbled together), I add seven
I was looking into using some .NET code from within a Delphi program, I
I've built an iPhone application using the parsing code from the TopSongs sample iPhone
I am creating a random ID using the below code: from random import *
Okay this is a revised question from earlier today, I have included code to
My main solution is using code from a utility class library, that I wrote
I am attempting to construct my own date picker using code from several sources.
I am attempting to construct my own date picker using code from several sources.
I'm using some code from here to determine when determining when the last finger

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.