Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
CharsetReader , if non-nil, defines a function to generate charset-conversion readers, converting from the provided charset into UTF-8. Charsets are always lower-case. utf-8 and us-ascii charsets are handled by default. One of the CharsetReader's result values must be non-nil.
Importing github.com/emersion/go-message/charset will set CharsetReader to a function that handles most common charsets. Alternatively, CharsetReader can be set to e.g. golang.org/x/net/html/charset.NewReaderLabel.
Functions ¶
func IsUnknownCharset ¶ added in v1.0.4
IsUnknownCharset returns a boolean indicating whether the error is known to report that the charset advertised by the entity is unknown.
func Reader ¶ added in v1.0.4
Reader returns an io.Reader that converts the provided charset to UTF-8.
func RegisterEncoding ¶ added in v1.0.4
RegisterEncoding registers an encoding. This is intended to be called from the init function in packages that want to support additional charsets.
Types ¶
type Attachment ¶
Attachment with filename, content type and data (as a io.Reader)
type Email ¶
type Email struct { Header mail.Header Subject string Sender *mail.Address From []*mail.Address ReplyTo []*mail.Address To []*mail.Address Cc []*mail.Address Bcc []*mail.Address Date time.Time MessageID string InReplyTo []string References []string ResentFrom []*mail.Address ResentSender *mail.Address ResentTo []*mail.Address ResentDate time.Time ResentCc []*mail.Address ResentBcc []*mail.Address ResentMessageID string ContentType string Content io.Reader HTMLBody string TextBody string Attachments []Attachment EmbeddedFiles []EmbeddedFile EmbeddedEmails []Attachment }
Email with fields for all the headers defined in RFC5322 with it's attachments and
type EmbeddedFile ¶
EmbeddedFile with content id, content type and data (as a io.Reader)
type UnknownCharsetError ¶ added in v1.0.4
type UnknownCharsetError struct {
// contains filtered or unexported fields
}
func (UnknownCharsetError) Error ¶ added in v1.0.4
func (u UnknownCharsetError) Error() string
func (UnknownCharsetError) Unwrap ¶ added in v1.0.4
func (u UnknownCharsetError) Unwrap() error