diff options
Diffstat (limited to 'src/SendMail.hs')
-rw-r--r-- | src/SendMail.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/SendMail.hs b/src/SendMail.hs new file mode 100644 index 0000000..23b1b80 --- /dev/null +++ b/src/SendMail.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE OverloadedStrings #-} + +module SendMail + ( sendMail + ) where + +import Data.Text (Text) +import Data.Text.Lazy (fromStrict) + +import Network.Mail.Mime + +sendMail :: Text -> Text -> Text -> Text -> IO () +sendMail to from subject body = do + renderSendMail (simpleMail' (address to) (address from) subject (fromStrict body)) + +address :: Text -> Address +address email = + Address + { addressName = Nothing + , addressEmail = email + } |