happstack-util-0.3.1: Web frameworkSource codeContentsIndex
Happstack.Util.Mail
Portabilitylinux/windows
Stabilityprovisional
MaintainerMatthew Elder
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 Happstack.Util.Mail
 main :: IO ()
 main = do
     sendSimpleMessages "10.2.23.11" "example.com" [message]
     where message = SimpleMessage
                         [NameAddr (Just "John Doe") "johnd@example.com"]
                         [NameAddr (Just "Patch-Tag Team") "team@patch-tag.com"]
                         "My test email using Happstack.Util.Mail"
                         "Hi, this is a test email which uses Happstack."
Synopsis
NameAddr (NameAddr, nameAddr_name, nameAddr_addr)
data SimpleMessage = SimpleMessage {
from :: [NameAddr]
to :: [NameAddr]
subject :: String
body :: String
}
sendRawMessages :: SockAddr -> String -> [Message] -> IO ()
sendSimpleMessages :: String -> String -> [SimpleMessage] -> IO ()
Documentation
NameAddr (NameAddr, nameAddr_name, nameAddr_addr)
data SimpleMessage Source
Constructors
SimpleMessage
from :: [NameAddr]The sender(s)
to :: [NameAddr]The recipient(s)
subject :: StringThe subject line
body :: StringThe body
show/hide Instances
sendRawMessagesSource
:: SockAddrSockAddr for the smarthost
-> StringHELO 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.
sendSimpleMessagesSource
:: StringIP address of the smarthost
-> StringHELO 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.
Produced by Haddock version 2.4.2