License | BSD3 |
---|---|
Maintainer | Enzo Haussecker |
Stability | Experimental |
Portability | Unknown |
Safe Haskell | None |
Language | Haskell2010 |
A dead simple SMTP Client for sending Gmail.
Sending
:: Text | username |
-> Text | password |
-> Address | from |
-> [Address] | to |
-> [Address] | cc |
-> [Address] | bcc |
-> Text | subject |
-> Text | body |
-> [FilePath] | attachments |
-> Int | timeout (in microseconds) |
-> IO () |
Send an email from your Gmail account using the simple message transfer protocol with transport layer security. If you have 2-step verification enabled on your account, then you will need to retrieve an application specific password before using this function. Below is an example using ghci, where Alice sends an Excel spreadsheet to Bob.
>>> :set -XOverloadedStrings >>> :module Network.Mail.Mime Network.Mail.Client.Gmail >>> sendGmail "alice" "password" (Address (Just "Alice") "alice@gmail.com") [Address (Just "Bob") "bob@example.com"] [] [] "Excel Spreadsheet" "Hi Bob,\n\nThe Excel spreadsheet is attached.\n\nRegards,\n\nAlice" ["Spreadsheet.xls"] 10000000