Hello Hua,

Have you tried using JavaMail to fetch email from a different (non
gmail) ssl mail server?  I.E. is the problem gmail specific? BTW: your
debug output ("DEBUG POP3: connecting to host "pop.gmail.com", port 995,
isSSL false") seems to indicate that you are *not* connecting over
SSL...

You might be interested in checking out the Gmail 4 Java api (available
at http://g4j.sourceforge.net/) - at the very least i'm sure you will
find some knowledgeable people on their lists/forums/etc.

Regs,
/t

>-----Original Message-----
>Subject: Using JavaMail to send/fetch emails via SSL
>From: "Hua Wei" <[EMAIL PROTECTED]>
>Date: Tue, 30 Aug 2005 10:05:45 -0400
>Thread: 
>http://www.houseoffusion.com/cf_lists/index.cfm/method=messages
>&threadid=41987&forumid=4#216758
>
>Hello All,
>Anyone using JavaMail and coldfusion together to send/fetch 
>emails via SSL?
>
>I tried gmail, but got time out errors. Increased the time 
>limit, but didn't help. 
>non-ssl emails work fine.
>
>Any suggestions? Thanks in advance
>
>Hua
>
>JavaMail version: 1.3.2
>System: CFMX 7 enterprise on windows 2000
>
>======== code ========================
>
><cfscript>
>  username = "[username]";
>  password = "[password]";
>  debug = true;
>
>  POP_HOST_NAME = "pop.gmail.com";
>  POP_PORT = "995"; //995 for gmail
>  SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
>  
>  prop = createObject("Java", "java.util.Properties").init();
>  prop.setProperty("javax.mail.pop3.starttls.enable", "true");
>  prop.setProperty("javax.mail.pop3.socketFactory.class", SSL_FACTORY);
>  prop.setProperty("javax.mail.pop3.socketFactory.fallback", "false");
>  prop.setProperty("javax.mail.pop3.port", POP_PORT);
>  prop.setProperty("javax.mail.pop3.socketFactory.port", POP_PORT);
>  
>  urlName = createObject("Java", "javax.mail.URLName");
>  urlName.init("pop3",POP_HOST_NAME,POP_PORT,JavaCast("null", 
>""),username,password);
>  
>  mySession = createObject("java", 
>"javax.mail.Session").getInstance(prop);
>  mySession.setDebug(debug);
>  
>  store = mySession.getStore(urlName);
>  
>  // connect to mailbox
>   store.connect();
>     inbox = store.getFolder("INBOX");
>     inbox.open(inbox.READ_ONLY);
>  
>     messages = inbox.getMessages();
>  store.close(); 
></cfscript>
>=========================
>=================== fetching debug output ===========================
>DEBUG: setDebug: JavaMail version 1.3.2
>DEBUG: getProvider() returning 
>javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun 
>Microsy stems, Inc]
>DEBUG POP3: connecting to host "pop.gmail.com", port 995, isSSL false
>S: EOF
>08/30 09:43:11 Warning [jrpp-2] - Thread: jrpp-2, processing 
>template: D:\HTDOCS\webroot\test_gmailget.cfm, completed in 60 
>seconds, exceeding the 60 second warning limit
>C: QUIT
>S: EOF
>=============================================

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216813
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to