Skip to content

Instantly share code, notes, and snippets.

@satosystems
Last active September 11, 2019 05:11
Show Gist options
  • Save satosystems/3e04ac18df127123dcd2 to your computer and use it in GitHub Desktop.
Save satosystems/3e04ac18df127123dcd2 to your computer and use it in GitHub Desktop.
Network.Mail.Mime でのメール送信方法 ref: https://qiita.com/satosystems/items/43ad35db2a289c15c998
{-# LANGUAGE OverloadedStrings #-}
import Network.Mail.Mime
main :: IO ()
main = renderSendMail mail'
where
from = Address Nothing "from@example.com"
mail = addPart [plainPart "本文"] $ emptyMail from
mail' = mail { mailHeaders = [ ("to", "to1@example.com, to2@example.com")
, ("subject", "件名")
]
}
{-# LANGUAGE OverloadedStrings #-}
import Network.Mail.Mime
main :: IO ()
main =
renderSendMail $ simpleMail'
(Address Nothing "to@example.com")
(Address Nothing "from@example.com")
"件名"
"本文"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment