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

-- | Compose MIME email messages.
--   
--   Hackage documentation generation is not reliable. For up to date
--   documentation, please see:
--   http://www.stackage.org/package/mime-mail.
@package mime-mail
@version 0.5.1

module Network.Mail.Mime

-- | MIME boundary between parts of a message.
newtype Boundary
Boundary :: Text -> Boundary
[unBoundary] :: Boundary -> Text

-- | An entire mail message.
data Mail
Mail :: Address -> [Address] -> [Address] -> [Address] -> Headers -> [Alternatives] -> Mail
[mailFrom] :: Mail -> Address
[mailTo] :: Mail -> [Address]
[mailCc] :: Mail -> [Address]
[mailBcc] :: Mail -> [Address]

-- | Other headers, excluding from, to, cc and bcc.
[mailHeaders] :: Mail -> Headers

-- | A list of different sets of alternatives. As a concrete example:
--   
--   
--   mailParts = [ [textVersion, htmlVersion], [attachment1], [attachment1]]
--   
--   
--   Make sure when specifying alternatives to place the most preferred
--   version last.
[mailParts] :: Mail -> [Alternatives]

-- | A mail message with the provided from address and no other
--   fields filled in.
emptyMail :: Address -> Mail
data Address
Address :: Maybe Text -> Text -> Address
[addressName] :: Address -> Maybe Text
[addressEmail] :: Address -> Text

-- | Multiple alternative representations of the same data. For example,
--   you could provide a plain-text and HTML version of a message.
type Alternatives = [Part]

-- | A single part of a multipart message.
data Part
Part :: Text -> Encoding -> Disposition -> Headers -> PartContent -> Part

-- | content type
[partType] :: Part -> Text
[partEncoding] :: Part -> Encoding

-- | The filename for this part, if it is to be sent with an attachemnt
--   disposition.
[partDisposition] :: Part -> Disposition
[partHeaders] :: Part -> Headers
[partContent] :: Part -> PartContent

-- | NestedParts are for multipart-related: One HTML part and some inline
--   images
data PartContent
PartContent :: ByteString -> PartContent
NestedParts :: [Part] -> PartContent
data Disposition
AttachmentDisposition :: Text -> Disposition
InlineDisposition :: Text -> Disposition
DefaultDisposition :: Disposition

-- | How to encode a single part. You should use Base64 for binary
--   data.
data Encoding
None :: Encoding
Base64 :: Encoding
QuotedPrintableText :: Encoding
QuotedPrintableBinary :: Encoding
data InlineImage
InlineImage :: Text -> ImageContent -> Text -> InlineImage
[imageContentType] :: InlineImage -> Text
[imageContent] :: InlineImage -> ImageContent
[imageCID] :: InlineImage -> Text
data ImageContent
ImageFilePath :: FilePath -> ImageContent
ImageByteString :: ByteString -> ImageContent
type Headers = [(ByteString, Text)]

-- | Render a Mail with a given RandomGen for producing
--   boundaries.
renderMail :: RandomGen g => g -> Mail -> (ByteString, g)

-- | Like renderMail, but generates a random boundary.
renderMail' :: Mail -> IO ByteString

-- | 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 ()

-- | Like sendmailCustom, but also returns sendmail's output to
--   stderr and stdout as strict ByteStrings.
--   
--   Since 0.4.9
sendmailCustomCaptureOutput :: FilePath -> [String] -> ByteString -> IO (ByteString, ByteString)

-- | 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 ()

-- | A simple interface for generating an email with HTML and plain-text
--   alternatives and some file attachments.
--   
--   Note that we use lazy IO for reading in the attachment contents.
simpleMail :: Address -> Address -> Text -> Text -> Text -> [(Text, FilePath)] -> IO Mail

-- | A simple interface for generating an email with only plain-text body.
simpleMail' :: Address -> Address -> Text -> Text -> Mail

-- | A simple interface for generating an email with HTML and plain-text
--   alternatives and some ByteString attachments.
--   
--   Since 0.4.7
simpleMailInMemory :: Address -> Address -> Text -> Text -> Text -> [(Text, Text, ByteString)] -> Mail

-- | An interface for generating an email with HTML and plain-text
--   alternatives, some file attachments, and inline images. Note that we
--   use lazy IO for reading in the attachment and inlined images. Inline
--   images can be referred to from the HTML content using the
--   src="cid:{{CONTENT-ID}}" syntax, where CONTENT-ID is the
--   filename of the image.
--   
--   Since 0.5.0
simpleMailWithImages :: [Address] -> Address -> Text -> Text -> Text -> [InlineImage] -> [(Text, FilePath)] -> IO Mail

-- | Add an Alternative to the Mails parts.
--   
--   To e.g. add a plain text body use > addPart [plainPart body]
--   (emptyMail from)
addPart :: Alternatives -> Mail -> Mail

-- | Add an attachment from a file and construct a Part.
addAttachment :: Text -> FilePath -> Mail -> IO Mail
addAttachments :: [(Text, FilePath)] -> Mail -> IO Mail

-- | Add an attachment from a ByteString and construct a
--   Part.
--   
--   Since 0.4.7
addAttachmentBS :: Text -> Text -> ByteString -> Mail -> Mail

-- | Since 0.4.7
addAttachmentsBS :: [(Text, Text, ByteString)] -> Mail -> Mail

-- | Format an E-Mail address according to the name-addr form (see: RFC5322
--   § 3.4 "Address specification", i.e: [display-name]
--   <addr-spec>) This can be handy for adding custom
--   headers that require such format.
renderAddress :: Address -> Text

-- | Construct a UTF-8-encoded html Part.
htmlPart :: Text -> Part

-- | Construct a UTF-8-encoded plain-text Part.
plainPart :: Text -> Part

-- | Construct a BASE64-encoded file attachment Part
--   
--   Since 0.5.0
filePart :: Text -> FilePath -> IO Part

-- | Construct a BASE64-encoded file attachment Part
--   
--   Since 0.5.0
filePartBS :: Text -> Text -> ByteString -> Part

-- | Generates a random sequence of alphanumerics of the given length.
randomString :: RandomGen d => Int -> d -> (String, d)

-- | The first parameter denotes whether the input should be treated as
--   text. If treated as text, then CRs will be stripped and LFs output as
--   CRLFs. If binary, then CRs and LFs will be escaped.
quotedPrintable :: Bool -> ByteString -> Builder

-- | Add a Related Part
relatedPart :: [Part] -> Part

-- | Add an inline image from a file and construct a Part.
--   
--   Since 0.5.0
addImage :: InlineImage -> IO Part
mkImageParts :: [InlineImage] -> IO [Part]
instance GHC.Classes.Eq Network.Mail.Mime.Address
instance GHC.Classes.Eq Network.Mail.Mime.Boundary
instance GHC.Classes.Eq Network.Mail.Mime.Disposition
instance GHC.Classes.Eq Network.Mail.Mime.Encoding
instance GHC.Classes.Eq Network.Mail.Mime.Part
instance GHC.Classes.Eq Network.Mail.Mime.PartContent
instance GHC.Classes.Eq Network.Mail.Mime.QPC
instance GHC.Internal.Generics.Generic Network.Mail.Mime.Address
instance GHC.Internal.Generics.Generic Network.Mail.Mime.Disposition
instance GHC.Internal.Generics.Generic Network.Mail.Mime.Encoding
instance GHC.Internal.Generics.Generic Network.Mail.Mime.Mail
instance GHC.Internal.Generics.Generic Network.Mail.Mime.Part
instance GHC.Internal.Generics.Generic Network.Mail.Mime.PartContent
instance GHC.Internal.Data.String.IsString Network.Mail.Mime.Address
instance System.Random.Random Network.Mail.Mime.Boundary
instance GHC.Internal.Show.Show Network.Mail.Mime.Address
instance GHC.Internal.Show.Show Network.Mail.Mime.Boundary
instance GHC.Internal.Show.Show Network.Mail.Mime.Disposition
instance GHC.Internal.Show.Show Network.Mail.Mime.Encoding
instance GHC.Internal.Show.Show Network.Mail.Mime.ImageContent
instance GHC.Internal.Show.Show Network.Mail.Mime.InlineImage
instance GHC.Internal.Show.Show Network.Mail.Mime.Mail
instance GHC.Internal.Show.Show Network.Mail.Mime.Part
instance GHC.Internal.Show.Show Network.Mail.Mime.PartContent
