mirror of
https://git.nerfingen.de/nerf/choirMail.git
synced 2025-05-15 17:50:31 +00:00
first working commit
This commit is contained in:
parent
2e2bbcd0d6
commit
0447d72e71
13 changed files with 465 additions and 0 deletions
18
app/Sender.hs
Normal file
18
app/Sender.hs
Normal file
|
@ -0,0 +1,18 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module Sender where
|
||||
|
||||
import Network.Mail.Mime
|
||||
import Network.Mail.SMTP
|
||||
import qualified Data.Text as ST
|
||||
import qualified Data.Text.Lazy as LT
|
||||
|
||||
|
||||
generateMail :: ST.Text -> ST.Text -> ST.Text -> LT.Text -> Mail
|
||||
generateMail to from subj = simpleMail' (Address Nothing to) (Address Nothing from) subj
|
||||
|
||||
-- domain -> Username -> password -> To -> From -> Subject -> Body
|
||||
send :: String -> String -> String -> ST.Text -> ST.Text -> ST.Text -> LT.Text -> IO ()
|
||||
send domain user pass to from subj body = sendMailWithLoginTLS domain user pass mail
|
||||
where
|
||||
mail = generateMail to from subj body
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue