MIME boundary between parts of a message.
Modulemime-mail-0.5.1Haskell2010
Network.Mail.Mime
- 11 types
- 27 values
- Packagemime-mail-0.5.1
- Exports38
- LanguageHaskell2010
- LicenceMIT
- SourceMime.hs
Datatypes
12 declarationsAn entire mail message.
Constructors
MailmailFrom :: AddressmailTo :: [Address]mailCc :: [Address]mailBcc :: [Address]mailHeaders :: HeadersOther headers, excluding from, to, cc and bcc.
mailParts :: [Alternatives]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.
Instances3Show, Generic, Rep
Show MailDefined in mime-mail-0.5.1 · Network.Mail.MimeGeneric MailDefined in mime-mail-0.5.1 · Network.Mail.Mimetype Rep Mail = D1 ('MetaDataDefined in mime-mail-0.5.1 · Network.Mail.Mime"Mail"
"Network.Mail.Mime"
"mime-mail-0.5.1-JryUHQEr5H3Bm5zrAekLTI"
'False) (C1 ('MetaCons"Mail"
'PrefixI 'True) ((S1 ('MetaSel ('Just"mailFrom"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Address) :*: (S1 ('MetaSel ('Just"mailTo"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Address]) :*: S1 ('MetaSel ('Just"mailCc"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Address]))) :*: (S1 ('MetaSel ('Just"mailBcc"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Address]) :*: (S1 ('MetaSel ('Just"mailHeaders"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Headers) :*: S1 ('MetaSel ('Just"mailParts"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Alternatives])))))
A mail message with the provided from address and no other
fields filled in.
Constructors
Instances5Eq, Show, IsString, Generic, Rep
Eq AddressDefined in mime-mail-0.5.1 · Network.Mail.MimeShow AddressDefined in mime-mail-0.5.1 · Network.Mail.MimeIsString AddressDefined in mime-mail-0.5.1 · Network.Mail.MimeGeneric AddressDefined in mime-mail-0.5.1 · Network.Mail.Mimetype Rep Address = D1 ('MetaDataDefined in mime-mail-0.5.1 · Network.Mail.Mime"Address"
"Network.Mail.Mime"
"mime-mail-0.5.1-JryUHQEr5H3Bm5zrAekLTI"
'False) (C1 ('MetaCons"Address"
'PrefixI 'True) (S1 ('MetaSel ('Just"addressName"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just"addressEmail"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Multiple alternative representations of the same data. For example, you could provide a plain-text and HTML version of a message.
A single part of a multipart message.
Constructors
PartpartType :: Textcontent type
partEncoding :: EncodingpartDisposition :: DispositionThe filename for this part, if it is to be sent with an attachemnt disposition.
partHeaders :: HeaderspartContent :: PartContent
Instances4Eq, Show, Generic, Rep
Eq PartDefined in mime-mail-0.5.1 · Network.Mail.MimeShow PartDefined in mime-mail-0.5.1 · Network.Mail.MimeGeneric PartDefined in mime-mail-0.5.1 · Network.Mail.Mimetype Rep Part = D1 ('MetaDataDefined in mime-mail-0.5.1 · Network.Mail.Mime"Part"
"Network.Mail.Mime"
"mime-mail-0.5.1-JryUHQEr5H3Bm5zrAekLTI"
'False) (C1 ('MetaCons"Part"
'PrefixI 'True) ((S1 ('MetaSel ('Just"partType"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just"partEncoding"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Encoding)) :*: (S1 ('MetaSel ('Just"partDisposition"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Disposition) :*: (S1 ('MetaSel ('Just"partHeaders"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Headers) :*: S1 ('MetaSel ('Just"partContent"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PartContent)))))
NestedParts are for multipart-related: One HTML part and some inline images
Constructors
Instances4Eq, Show, Generic, Rep
Eq PartContentDefined in mime-mail-0.5.1 · Network.Mail.MimeShow PartContentDefined in mime-mail-0.5.1 · Network.Mail.MimeGeneric PartContentDefined in mime-mail-0.5.1 · Network.Mail.Mimetype Rep PartContent = D1 ('MetaDataDefined in mime-mail-0.5.1 · Network.Mail.Mime"PartContent"
"Network.Mail.Mime"
"mime-mail-0.5.1-JryUHQEr5H3Bm5zrAekLTI"
'False) (C1 ('MetaCons"PartContent"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :+: C1 ('MetaCons"NestedParts"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Part])))
Instances4Eq, Show, Generic, Rep
Eq DispositionDefined in mime-mail-0.5.1 · Network.Mail.MimeShow DispositionDefined in mime-mail-0.5.1 · Network.Mail.MimeGeneric DispositionDefined in mime-mail-0.5.1 · Network.Mail.Mimetype Rep Disposition = D1 ('MetaDataDefined in mime-mail-0.5.1 · Network.Mail.Mime"Disposition"
"Network.Mail.Mime"
"mime-mail-0.5.1-JryUHQEr5H3Bm5zrAekLTI"
'False) (C1 ('MetaCons"AttachmentDisposition"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons"InlineDisposition"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons"DefaultDisposition"
'PrefixI 'False) U1))
How to encode a single part. You should use Base64 for binary data.
Instances4Eq, Show, Generic, Rep
Eq EncodingDefined in mime-mail-0.5.1 · Network.Mail.MimeShow EncodingDefined in mime-mail-0.5.1 · Network.Mail.MimeGeneric EncodingDefined in mime-mail-0.5.1 · Network.Mail.Mimetype Rep Encoding = D1 ('MetaDataDefined in mime-mail-0.5.1 · Network.Mail.Mime"Encoding"
"Network.Mail.Mime"
"mime-mail-0.5.1-JryUHQEr5H3Bm5zrAekLTI"
'False) ((C1 ('MetaCons"None"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Base64"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"QuotedPrintableText"
'PrefixI 'False) U1 :+: C1 ('MetaCons"QuotedPrintableBinary"
'PrefixI 'False) U1))
Constructors
Instances1Show
Show InlineImageDefined in mime-mail-0.5.1 · Network.Mail.Mime
Constructors
Instances1Show
Show ImageContentDefined in mime-mail-0.5.1 · Network.Mail.Mime
Render a message
2 declarationsLike renderMail, but generates a random boundary.
Sending messages
5 declarationsSend a fully-formed email message via the default sendmail executable with default options.
sendmailCustom :: FilePathsendmail executable path
-> [String]sendmail command-line options
-> ByteStringmail message as lazy bytestring
-> IO ()
Send a fully-formed email message via the specified sendmail executable with specified options.
Like sendmailCustom, but also returns sendmail's output to stderr and stdout as strict ByteStrings.
Since 0.4.9
Render an email message and send via the default sendmail executable with default options.
renderSendMailCustom Render an email message and send via the specified sendmail executable with specified options.
High-level Mail creation
4 declarationssimpleMail 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.
A simple interface for generating an email with only plain-text body.
simpleMailInMemory A simple interface for generating an email with HTML and plain-text
alternatives and some ByteString attachments.
Since 0.4.7
simpleMailWithImages 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
Utilities
15 declarationsAdd an Alternative to the Mails parts.
To e.g. add a plain text body use > addPart [plainPart body] (emptyMail from)
Add an attachment from a file and construct a Part.
Add an attachment from a ByteString and construct a Part.
Since 0.4.7
Since 0.4.7
Construct a UTF-8-encoded html Part.
Construct a UTF-8-encoded plain-text Part.
Construct a BASE64-encoded file attachment Part
Since 0.5.0
Construct a BASE64-encoded file attachment Part
Since 0.5.0
Generates a random sequence of alphanumerics of the given length.
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.
Add an inline image from a file and construct a Part.
Since 0.5.0