ismtp-2.0.0: Advanced ESMTP library

Stabilityexperimental
MaintainerErtugrul Soeylemez <es@ertes.de>

Network.Smtp.Monad

Contents

Description

This module implements a monad for SMTP sessions.

Synopsis

Running sessions

runMailT :: (Applicative m, Monad m) => Handle -> StringMailT (Either SomeException a) m a -> m (Either SomeException a)Source

Run a mail session computation with the given output handle. The input is supplied by an Enumerator such as enumHandleTimeout.

runMailT_ :: (Applicative m, MonadIO m) => Handle -> StringMailT (Either SomeException a) m a -> m aSource

Run a mail session computation using runMailT and throw an exception on error.

Utility functions

mailError :: Monad m => SmtpCommand -> String -> Integer -> Vector ByteString -> MailT r m aSource

Format a bad response together with the supplied error message and throw an SmtpException in the underlying Iteratee.

mailPut :: MonadIO m => Enumerator ByteString (MailT r m) () -> MailT r m ()Source

Send a stream of ByteStrings to the SMTP server.

mailPutLn :: MonadIO m => [ByteString] -> MailT r m ()Source

Send a list of ByteStrings followed an SMTP line terminator to the SMTP server.

nextResponse :: Monad m => MailT r m SmtpResponseSource

Retrieve the next SMTP response. Throw an Error, if there is no next response.