You can use HaskellNet or imapget directly or look into their source code for connecting to imap manually.-SatvikOn Sat, Feb 23, 2013 at 8:58 PM, C K Kashyap <ckkashyap@gmail.com> wrote:
_______________________________________________Hi,I am trying to use Haskell to download email/attachments from gmail. For which I am exploring Network.TLS. I got this sample from the net that connects to gmail smtp and works just fine -However, when I modify it a bit to try to connect to imap, it simply does not work. To debug, I tried to connect to a webserver, even that seems to not work. I modified the function as follows.emailGmail2 = dolet host = "localhost"let port = 443let params = defaultParamsClient{pCiphers = ciphers}g <- RNG.makeSystemh <- connectTo host (PortNumber (fromIntegral port))hSetBuffering h LineBufferingcWrite h "GET / HTTP/1.0"cWrite h ""cWaitFor h "ABCD"con <- contextNewOnHandle h params ghandshake conbye conAnd I get a "BAD request" response from the server - Can some please give me a sample code that uses Network.TLS to connect to a imap.google.com (or even a webserver for that matter)?Regards,Kashyap
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe