I have PAC file and proxy port with me but not able to login and readGMail mails. Can anyone show me how to use PAC and proxy port in JAVAMAIL API .I have done setting like
propsIMAP = new Properties();
propsSMTP = new Properties();
propsIMAP.setProperty("http.proxyHost", "http-proxy01.domain.com");
propsIMAP.setProperty("http.proxyPort", "88");
propsIMAP.put("mail.imap.starttls.enable","true");
propsIMAP.put("mail.imap.host", ImapServerName);
propsIMAP.put("mail.imap.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
propsIMAP.put("mail.imap.socketFactory.fallback", "false");
propsIMAP.put("mail.transport.protocol", "imaps");
propsIMAP.put("mail.imap.auth", "true");
propsIMAP.put("mail.imaps.port", "993");
and getting error as :
DEBUG IMAP: mail.imap.fetchsize: 16384
DEBUG IMAP: mail.imap.ignorebodystructuresize: false
DEBUG IMAP: mail.imap.statuscachetimeout: 1000
DEBUG IMAP: mail.imap.appendbuffersize: -1
DEBUG IMAP: mail.imap.minidletime: 10
DEBUG IMAP: enable STARTTLS
DEBUG IMAP: trying to connect to host "webmail.gmail.com", port 993, isSSL false
javax.mail.MessagingException: webmail.gmail.com;
nested exception is:
java.net.UnknownHostException: webmail.gmail.com
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:670)
The problem here is that you are trying to connect to a host that simply doesn't exist. Correct settings for gmail are :-
You can use the following :-