smtps-gmail-1.2.1: Gmail SMTP Client

CopyrightCopyright (c) 2014, Enzo Haussecker. All rights reserved.
LicenseBSD3
MaintainerEnzo Haussecker <ehaussecker@gmail.com>
StabilityExperimental
PortabilityUnknown
Safe HaskellNone
LanguageHaskell2010

Network.Mail.Client.Gmail

Description

A simple SMTP Client for sending Gmail.

Synopsis

Documentation

sendGmail Source

Arguments

:: Text

username

-> Text

password

-> Address

from

-> [Address]

to

-> [Address]

cc

-> [Address]

bcc

-> Text

subject

-> Text

body

-> [FilePath]

attachments

-> 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"]