gmail app 504 server timeout
Posted
by
Hui
on Stack Overflow
See other posts from Stack Overflow
or by Hui
Published on 2011-01-14T00:26:33Z
Indexed on
2011/01/14
0:53 UTC
Read the original article
Hit count: 113
this is the part of code I use for getting info from gmail, it's working alright on my localhost, but somehow when i deploy it online, I got 504 gateway timeout error. Did I missed something in my code? can someone give some advices , thanks a lot
public class GetGmail {
static String last = null; public static ArrayList run(String username, String password, String lastloggin)throws Exception { ArrayList result = null; System.out.println("Getting Gmail......");
last = lastloggin; 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.googlemail.com", username, password); result = readMessage(store); store.close();
} catch (NoSuchProviderException e) { e.printStackTrace(); return null; } catch (MessagingException e) { e.printStackTrace(); return null; } return result; } }
© Stack Overflow or respective owner