From b53f096d4a6de8bc3badd77ea308ea46406e4711 Mon Sep 17 00:00:00 2001 From: "Daniel P. Wright" Date: Tue, 27 Aug 2013 10:05:41 +0900 Subject: [PATCH] Logout/Close the connections once we're done --- examples/gmail.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/gmail.hs b/examples/gmail.hs index 7891652..fd6e661 100644 --- a/examples/gmail.hs +++ b/examples/gmail.hs @@ -25,11 +25,13 @@ imapTest = do let firstMsg = head msgs msgContent <- fetch c firstMsg B.putStrLn msgContent + logout c smtpTest = do c <- connectSMTPSTARTTLS "smtp.gmail.com" sendCommand c $ AUTH PLAIN username password sendMail username [recipient] mailContent c + closeSMTP c where mailContent = subject `B.append` body subject = "Subject: Test message\r\n\r\n" body = "This is a test message"