smtps-gmail-1.3.1: Gmail SMTP Client

LicenseBSD3
MaintainerEnzo Haussecker
StabilityExperimental
PortabilityUnknown
Safe HaskellNone
LanguageHaskell2010

Network.Mail.Client.Gmail

Contents

Description

A dead simple SMTP Client for sending Gmail.

Synopsis

Sending

sendGmail Source

Arguments

:: 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

Exceptions