-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Simple email sending via SMTP
--   
--   Simple email sending via SMTP
@package smtp-mail
@version 0.1.4.6

module Network.Mail.SMTP.Auth
type UserName = String
type Password = String
data AuthType
PLAIN :: AuthType
LOGIN :: AuthType
CRAM_MD5 :: AuthType
encodeLogin :: UserName -> Password -> (ByteString, ByteString)
auth :: AuthType -> String -> UserName -> Password -> ByteString
instance GHC.Classes.Eq Network.Mail.SMTP.Auth.AuthType
instance GHC.Show.Show Network.Mail.SMTP.Auth.AuthType

module Network.Mail.SMTP.Types
data Command
HELO :: ByteString -> Command
EHLO :: ByteString -> Command
MAIL :: ByteString -> Command
RCPT :: ByteString -> Command
DATA :: ByteString -> Command
EXPN :: ByteString -> Command
VRFY :: ByteString -> Command
HELP :: ByteString -> Command
AUTH :: AuthType -> UserName -> Password -> Command
NOOP :: Command
RSET :: Command
QUIT :: Command
type ReplyCode = Int
data Response
Ok :: Response
SystemStatus :: Response
HelpMessage :: Response
ServiceReady :: Response
ServiceClosing :: Response
UserNotLocal :: Response
CannotVerify :: Response
StartMailInput :: Response
ServiceNotAvailable :: Response
MailboxUnavailable :: Response
ErrorInProcessing :: Response
InsufficientSystemStorage :: Response
SyntaxError :: Response
ParameterError :: Response
CommandNotImplemented :: Response
BadSequence :: Response
ParameterNotImplemented :: Response
MailboxUnavailableError :: Response
UserNotLocalError :: Response
ExceededStorage :: Response
MailboxNotAllowed :: Response
TransactionFailed :: Response
type UserName = String
type Password = String
data AuthType
PLAIN :: AuthType
LOGIN :: AuthType
CRAM_MD5 :: AuthType
data Address :: *
Address :: Maybe Text -> Text -> Address
[addressName] :: Address -> Maybe Text
[addressEmail] :: Address -> Text
instance GHC.Classes.Eq Network.Mail.SMTP.Types.Response
instance GHC.Show.Show Network.Mail.SMTP.Types.Response
instance GHC.Classes.Eq Network.Mail.SMTP.Types.Command
instance GHC.Show.Show Network.Mail.SMTP.Types.Command

module Network.Mail.SMTP

-- | Connect to an SMTP server, send a Mail, then disconnect. Uses
--   the default port (25).
sendMail :: HostName -> Mail -> IO ()

-- | Connect to an SMTP server, send a Mail, then disconnect.
sendMail' :: HostName -> PortNumber -> Mail -> IO ()

-- | Connect to an SMTP server, login, send a Mail, disconnect. Uses
--   the default port (25).
sendMailWithLogin :: HostName -> UserName -> Password -> Mail -> IO ()

-- | Connect to an SMTP server, login, send a Mail, disconnect.
sendMailWithLogin' :: HostName -> PortNumber -> UserName -> Password -> Mail -> IO ()

-- | Send a Mail with a given sender.
sendMailWithSender :: ByteString -> HostName -> Mail -> IO ()

-- | Send a Mail with a given sender.
sendMailWithSender' :: ByteString -> HostName -> PortNumber -> Mail -> IO ()

-- | A simple interface for generating a Mail with a plantext body
--   and an optional HTML body.
simpleMail :: Address -> [Address] -> [Address] -> [Address] -> Text -> [Part] -> Mail

-- | Construct a plain text Part
plainTextPart :: Text -> Part

-- | Construct an html Part
htmlPart :: Text -> Part

-- | Construct a file attachment Part
filePart :: Text -> FilePath -> IO Part
data SMTPConnection

-- | Send a fully-formed email message via the default sendmail executable
--   with default options.
sendmail :: ByteString -> IO ()

-- | Send a fully-formed email message via the specified sendmail
--   executable with specified options.
sendmailCustom :: FilePath -> [String] -> ByteString -> IO ()

-- | Render an email message and send via the default sendmail executable
--   with default options.
renderSendMail :: Mail -> IO ()

-- | Render an email message and send via the specified sendmail executable
--   with specified options.
renderSendMailCustom :: FilePath -> [String] -> Mail -> IO ()

-- | Connect to an SMTP server with the specified host and default port
--   (25)
connectSMTP :: HostName -> IO SMTPConnection

-- | Connect to an SMTP server with the specified host and port
connectSMTP' :: HostName -> PortNumber -> IO SMTPConnection

-- | Connect to an SMTP server with the specified host and port
connectSMTPWithHostName :: HostName -> PortNumber -> IO String -> IO SMTPConnection

-- | Send a Command to the SMTP server
sendCommand :: SMTPConnection -> Command -> IO (ReplyCode, ByteString)

-- | A convenience function that sends AUTH LOGIN to the
--   server
login :: SMTPConnection -> UserName -> Password -> IO (ReplyCode, ByteString)

-- | Send QUIT and close the connection.
closeSMTP :: SMTPConnection -> IO ()

-- | Render a Mail to a ByteString then send it over the
--   specified SMTPConnection
renderAndSend :: SMTPConnection -> Mail -> IO ()
renderAndSendFrom :: ByteString -> SMTPConnection -> Mail -> IO ()
instance GHC.Classes.Eq Network.Mail.SMTP.SMTPConnection
