smtp-mail-0.1.2.0: Simple email sending via SMTP

Safe HaskellNone

Network.Mail.SMTP

Contents

Synopsis

Main interface

sendMail :: String -> PortNumber -> Mail -> IO ()Source

Connect to an SMTP server, send a Mail, then disconnect.

sendMailWithLogin :: String -> PortNumber -> UserName -> Password -> Mail -> IO ()Source

Connect to an SMTP server, login, send a Mail, disconnect.

simpleMailSource

Arguments

:: Address

from

-> [Address]

to

-> Text

subject

-> Text

plain body

-> Maybe Text

optional HTML body

-> Mail 

A simple interface for generating a Mail with a plantext body and an optional HTML body.

Types

Auth Types (reexports)

data AuthType Source

Constructors

PLAIN 
LOGIN 
CRAM_MD5 

Instances

Network.Mail.Mime types (reexports)

data Address

Constructors

Address 

Network.Mail.Mime's sendmail interface (reexports)

sendmail :: ByteString -> IO ()

Send a fully-formed email message via the default sendmail executable with default options.

sendmailCustom

Arguments

:: FilePath

sendmail executable path

-> [String]

sendmail command-line options

-> ByteString

mail message as lazy bytestring

-> IO () 

Send a fully-formed email message via the specified sendmail executable with specified options.

renderSendMail :: Mail -> IO ()

Render an email message and send via the default sendmail executable with default options.

renderSendMailCustom

Arguments

:: FilePath

sendmail executable path

-> [String]

sendmail command-line options

-> Mail

mail to render and send

-> IO () 

Render an email message and send via the specified sendmail executable with specified options.

Establishing Connection

connectSMTPPortSource

Arguments

:: String

name of the server

-> PortNumber

port number

-> IO SMTPConnection 

Connect to an SMTP server with the specified host and port

connectSMTPSource

Arguments

:: String

name of the server

-> IO SMTPConnection 

Connect to an SMTP server with the specified host and default port (25)

Operation to a Connection

sendCommand :: SMTPConnection -> Command -> IO (ReplyCode, ByteString)Source

Send a Command to the SMTP server

closeSMTP :: SMTPConnection -> IO ()Source

Send QUIT and close the connection.

renderAndSend :: SMTPConnection -> Mail -> IO ()Source

Render a Mail to a ByteString then send it over the specified SMTPConnection