Logout/Close the connections once we're done
This commit is contained in:
parent
fe3f39ed4a
commit
b53f096d4a
@ -25,11 +25,13 @@ imapTest = do
|
|||||||
let firstMsg = head msgs
|
let firstMsg = head msgs
|
||||||
msgContent <- fetch c firstMsg
|
msgContent <- fetch c firstMsg
|
||||||
B.putStrLn msgContent
|
B.putStrLn msgContent
|
||||||
|
logout c
|
||||||
|
|
||||||
smtpTest = do
|
smtpTest = do
|
||||||
c <- connectSMTPSTARTTLS "smtp.gmail.com"
|
c <- connectSMTPSTARTTLS "smtp.gmail.com"
|
||||||
sendCommand c $ AUTH PLAIN username password
|
sendCommand c $ AUTH PLAIN username password
|
||||||
sendMail username [recipient] mailContent c
|
sendMail username [recipient] mailContent c
|
||||||
|
closeSMTP c
|
||||||
where mailContent = subject `B.append` body
|
where mailContent = subject `B.append` body
|
||||||
subject = "Subject: Test message\r\n\r\n"
|
subject = "Subject: Test message\r\n\r\n"
|
||||||
body = "This is a test message"
|
body = "This is a test message"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user