Update sample code to use doSMTPSTARTTLS
This commit is contained in:
parent
a5e240859c
commit
ecd9cf1651
@ -27,11 +27,9 @@ imapTest = do
|
|||||||
B.putStrLn msgContent
|
B.putStrLn msgContent
|
||||||
logout c
|
logout c
|
||||||
|
|
||||||
smtpTest = do
|
smtpTest = doSMTPSTARTTLS "smtp.gmail.com" $ \c -> do
|
||||||
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