SMTPClient-1.0.4: A simple SMTP client library

Copyright2009 Matthew Elder
LicenseBSD3
MaintainerMatthew Elder
Stabilityprovisional
Portabilitylinux/windows
Safe HaskellNone
LanguageHaskell98

Network.SMTP.Simple

Description

Mail is a simple library with which you can add email functionality to your application. It assumes you have access to a smarthost which can relay all your mail.

As an example:

import Network.SMTP.Simple
import System.IO

main :: IO ()
main = do
    sendSimpleMessages (hPutStrLn stderr) "10.2.23.11" "example.com" [message]
    where message = SimpleMessage
                        [NameAddr (Just "John Doe") "johnd@example.com"]
                        [NameAddr (Just "Team") "team@exmaple.com"]
                        "My test email using Network.SMTP.Simple"
                        "Hi, this is a test email which uses SMTPClient."

Synopsis

Documentation

data NameAddr :: *

A NameAddr is composed of an optional realname a mandatory e-mail address.

Instances

data SimpleMessage Source

Constructors

SimpleMessage 

Fields

from :: [NameAddr]

The sender(s)

to :: [NameAddr]

The recipient(s)

subject :: String

The subject line

body :: String

The body

Instances

sendRawMessages Source

Arguments

:: (String -> IO ())

Diagnostic log function

-> SockAddr

SockAddr for the smarthost

-> String

HELO domain (should be the same as your from-address-domain)

-> [Message]

List of messages to send

-> IO () 

Use this if you need more control than sendSimpleMessages gives you.

sendSimpleMessages Source

Arguments

:: (String -> IO ())

Diagnostic log function

-> String

IP address of the smarthost

-> String

HELO domain (should be the same as your from-address-domain)

-> [SimpleMessage]

List of simple messages to send

-> IO () 

Simplest way to send mail. Takes the smarthost ip, the HELO domain, and a list of SimpleMessage.