-- 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 <a>Mail</a>, then disconnect. Uses
--   the default port (25).
sendMail :: HostName -> Mail -> IO ()

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

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

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

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

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

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

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

-- | Construct an html <a>Part</a>
htmlPart :: Text -> Part

-- | Construct a file attachment <a>Part</a>
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 <a>Command</a> to the SMTP server
sendCommand :: SMTPConnection -> Command -> IO (ReplyCode, ByteString)

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

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

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