ismtp-1.0.2: Fast, incremental ESMTP sessions

Stabilityexperimental
MaintainerErtugrul Soeylemez <es@ertes.de>

Network.Smtp

Contents

Description

This package provides a monad for fast, incremental ESMTP sessions, with which you can, among other things, send emails. Here is an example session:

 mailSession :: ByteString -> ByteString -> ByteString ->
                Builder -> Mail ()
 mailSession srcDomain fromAddr toAddr content = do
     waitForWelcome
     sendHello srcDomain
     sendMailFrom fromAddr
     sendRcptTo toAddr
     sendData content
     sendQuit

You can use the sendMail function to send a mail via a domain's MX server, which is looked up via DNS. Alternatively you can connect to a specific SMTP server directly by using the sendMailDirect function. Finally for a low-level interface you can use the runMail function.

Synopsis

Reexports