Skip to content

Instantly share code, notes, and snippets.

@satosystems
Created January 15, 2016 19:26
Show Gist options
  • Save satosystems/4ccbb8845ff463cc5cd4 to your computer and use it in GitHub Desktop.
Save satosystems/4ccbb8845ff463cc5cd4 to your computer and use it in GitHub Desktop.
Network.Mail.Client.Gmail でのメール送信方法 ref: http://qiita.com/satosystems/items/c6c57d6d3b813d3dcb23
{-# LANGUAGE OverloadedStrings #-}
import Network.Mail.Client.Gmail
import Network.Mail.Mime
main :: IO ()
main = sendGmail
"foo@gmail.com" -- username
"password" -- password
(Address Nothing "from@example.com") -- from
[Address Nothing "to@example.com"] -- to
[] -- cc
[] -- bcc
"Subject" -- subject
"body1\nbody2\nbody3\n" -- body
[] -- attachments
30000000 -- timeout (in microseconds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment