ismtp-4.0.1: Network/Smtp.hs
-- |
-- Module: Network.SMTP
-- Copyright: (c) 2011 Ertugrul Soeylemez
-- License: BSD3
-- Maintainer: Ertugrul Soeylemez <es@ertes.de>
--
-- This package provides a monad transformer for fast, incremental ESMTP
-- sessions, with which you can, among other things, send emails. Here
-- is an example session:
--
-- > testSession ::
-- > (MailMonad m, MonadIO m) =>
-- > ByteString -> ByteString -> ByteString -> ByteString ->
-- > Iteratee SmtpResponse m ()
-- > testSession srcDomain fromAddr toAddr content = do
-- > waitForWelcome
-- > hello srcDomain
-- > mailFrom fromAddr
-- > rcptTo toAddr
-- > mailDataStr content
-- > quit
--
-- The simplest interfaces to running SMTP sessions are 'withSmtpConn'
-- and 'withMxConn'. The latter does a DNS lookup for the given domain
-- to discover the MX server and connect to it. The former simply
-- connects to the given hostname and port.
--
-- If you need more control over the connection handles and other
-- parameters like timeout and flood protection, you may want to use
-- 'sendMail' or 'sendMail_' instead. Those functions are also useful,
-- if you want to run an SMTP session using stdin and stdout for testing
-- or if you want to combine multiple stateful iteratees. This also
-- means that you have to run the underlying state computation yourself
-- for whatever state monad you work in. See documentation for
-- 'sendMail'.
--
-- Finally you can use the low level interface for running sessions. In
-- this case you will need to use the iteratee functions directly. This
-- is normally not necessary, as 'sendMail' does most of the boilerplate
-- for you. It can become useful, when you want to use some
-- enumeratees, e.g. to encapsulate the session in SSL or to go through
-- a proxy server. You can use the 'responseLines' function to convert
-- a raw 'ByteString' stream to a stream of 'SmtpResponse's.
module Network.Smtp
( -- * Reexports
module Network.Smtp.Connect,
module Network.Smtp.Monad,
module Network.Smtp.Session,
module Network.Smtp.Simple,
module Network.Smtp.Tools,
module Network.Smtp.Types
)
where
import Network.Smtp.Connect
import Network.Smtp.Monad
import Network.Smtp.Session
import Network.Smtp.Simple
import Network.Smtp.Tools
import Network.Smtp.Types