Documentation
¶
Overview ¶
Package eml reads email messages, in the Internet Message Format, with MIME parts, such as .eml files, and the messages in a mailbox: their subject, addresses, date and identifier, their text and HTML, decoded from their transfer encoding and character set, and their attachments
Index ¶
Constants ¶
const ContentType = "message/rfc822"
ContentType is the content type of an email message
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct {
// Its file name, which is empty when it has none
Name string
// Its content type, such as application/pdf, which is empty when it
// isn't known
ContentType string
// Its content, decoded from its transfer encoding, which is nil for an
// attachment which isn't in the message, such as one which Eudora
// saved to a folder, and listed in the message's X-Attachments header
Data []byte
}
Attachment is an attachment of an email message
type Message ¶
type Message struct {
// The message's header, as it is, which is empty for a message without
// one, such as a message which Eudora saved without its header
Header mail.Header
// The subject, with its encoded words decoded, such as =?big5?B?...?=
Subject string
// The addresses of the senders, the recipients, and the recipients who
// are copied, whose names have their encoded words decoded
From, To, Cc []*mail.Address
// When the message was sent, which is zero when it isn't known
Date time.Time
// The message's identifier, without its angle brackets
MessageID string
// The message's first plain text, and its first HTML, decoded from
// their transfer encoding and character set, which are empty when it
// has none. A message without a header is all text.
Text, HTML string
// The message's attachments, in their order
Attachments []Attachment
}
Message is an email message
func Parse ¶
Parse returns the email message, which is read to its end: its subject, addresses, date and identifier, its first plain text and HTML, and its attachments, including those which Eudora saved to a folder, and listed in its X-Attachments header. A message whose header can't be read, such as one which Eudora saved without it, is all text.