ismtp-2.0.0: Advanced ESMTP library

Stabilityexperimental
MaintainerErtugrul Soeylemez <es@ertes.de>

Network.Smtp.Connect

Contents

Description

High level interfaces for networking.

Synopsis

Connection

withMxConn :: (Applicative m, DnsMonad m, MonadPeelIO m) => Domain -> Bool -> MailT (Either SomeException a) m a -> m aSource

Interface to withSmtpConn, which connects to the first mail exchanger (MX) of the given domain on port 25. The Bool parameter specifies whether to fall back to the given domain itself, if no MX records can be found.

withSmtpConn :: forall a m. (Applicative m, MonadPeelIO m) => HostName -> PortID -> MailT (Either SomeException a) m a -> m aSource

Connect to the specified SMTP server and run the given computation. Note that there is also withMxConn, which resolves the MX server of the given domain.

Initialization

withIsmtp :: IO a -> IO aSource

Perform some useful (but not necessarily needed) initialization like disabling SIGPIPE and initializing sockets, run the given computation and then clean up.

Utility functions

ignoreSigPipe :: IO ()Source

Disable the SIGPIPE signal, so our program doesn't die on broken pipes.

withIgnoredSigPipe :: IO a -> IO aSource

Run the given computation with the SIGPIPE signal disabled, so our program doesn't die on broken pipes.