# README
go-message
A Go library for the Internet Message Format. It implements:
- RFC 5322: Internet Message Format
- RFC 2045, RFC 2046 and RFC 2047: Multipurpose Internet Mail Extensions
- RFC 2183: Content-Disposition Header Field
Features
- Streaming API
- Automatic encoding and charset handling (to decode all charsets, add
import _ "github.com/emersion/go-message/charset"
to your application) - A
mail
subpackage to read and write mail messages - DKIM-friendly
- A
textproto
subpackage that just implements the wire format
License
MIT
# Functions
CreateWriter creates a new message writer to w.
HeaderFromMap creates a header from a map of header fields.
IsUnknownCharset returns a boolean indicating whether the error is known to report that the charset advertised by the entity is unknown.
IsUnknownEncoding returns a boolean indicating whether the error is known to report that the encoding advertised by the entity is unknown.
New makes a new message with the provided header and body.
NewMultipart makes a new multipart message with the provided header and parts.
Read reads a message from r.
ReadWithOptions see Read, but allows overriding some parameters with ReadOptions.
# Variables
CharsetReader, if non-nil, defines a function to generate charset-conversion readers, converting from the provided charset into UTF-8.
# Structs
An Entity is either a whole message or a one of the parts in the body of a multipart entity.
A Header represents the key-value pairs in a message header.
ReadOptions are options for ReadWithOptions.
Writer writes message entities.
# Interfaces
HeaderFields iterates over header fields.
MultipartReader is an iterator over parts in a MIME multipart body.
# Type aliases
WalkFunc is the type of the function called for each part visited by Walk.