Last active
September 11, 2019 05:11
-
-
Save satosystems/3e04ac18df127123dcd2 to your computer and use it in GitHub Desktop.
Network.Mail.Mime でのメール送信方法 ref: https://qiita.com/satosystems/items/43ad35db2a289c15c998
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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", "件名") | |
] | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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