Namespace: go.std.net.mail
v1.0Contents
Summary
Provides a low-level interface to the net/mail package.
Package mail implements parsing of mail messages.
For the most part, this package follows the syntax as specified by RFC 5322 and
extended by RFC 6532.
Notable divergences:
- Obsolete address formats are not parsed, including addresses with
embedded route information.
- The full range of spacing (the CFWS syntax element) is not supported,
such as breaking addresses across lines.
- No unicode normalization is performed.
- The special characters ()[]:;@\, are allowed to appear unquoted in names.
Index
- *Address
- *AddressParser
- *Header
- *Message
- Address
- AddressParser
- ErrHeaderNotPresent
- Header
- Message
- ParseAddress
- ParseAddressList
- ParseDate
- ReadMessage
- arrayOfAddress
- arrayOfAddressParser
- arrayOfHeader
- arrayOfMessage
Legend
-
Constant
Variable
Function
Macro
Special form
Type
GoVar
Receiver/Method
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
ErrHeaderNotPresent
Var v1.0
Functions, Macros, and Special Forms
-
ParseAddress
Function v1.0(ParseAddress address)
ParseAddress parses a single RFC 5322 address, e.g. "Barry Gibbs <bg@example.com>"
Go input arguments: (address string)
Go returns: (*Address, error)
Joker input arguments: [^String address]
Joker returns: [^*Address, ^Error] -
ParseAddressList
Function v1.0(ParseAddressList list)
ParseAddressList parses the given string as a list of addresses.
Go input arguments: (list string)
Go returns: ([]*Address, error)
Joker input arguments: [^String list]
Joker returns: [^arrayOf*Address, ^Error] -
ParseDate
Function v1.0(ParseDate date)
ParseDate parses an RFC 5322 date string.
Go input arguments: (date string)
Go returns: (time.Time, error)
Joker input arguments: [^String date]
Joker returns: [^go.std.time/Time, ^Error] -
ReadMessage
Function v1.0(ReadMessage r)
ReadMessage reads a message from r.
The headers are parsed, and the body of the message will be available
for reading from msg.Body.
Go input arguments: (r io.Reader)
Go returns: (msg *Message, err error)
Joker input arguments: [^go.std.io/Reader r]
Joker returns: [^*Message msg, ^Error err]
Types
-
*Address
Concrete Type v1.0Address represents a single mail address.
An address such as "Barry Gibbs <bg@example.com>" is represented
as Address{Name: "Barry Gibbs", Address: "bg@example.com"}.
-
String
Receiver for *Address v1.0([])
String formats the address as a valid RFC 5322 address.
If the address's name contains non-ASCII characters
the name will be rendered according to RFC 2047.
-
*AddressParser
Concrete Type v1.0An AddressParser is an RFC 5322 address parser.
-
Parse
Receiver for *AddressParser v1.0([address])
Parse parses a single RFC 5322 address of the
form "Gogh Fir <gf@example.com>" or "foo@example.com".
-
ParseList
Receiver for *AddressParser v1.0([list])
ParseList parses the given string as a list of comma-separated addresses
of the form "Gogh Fir <gf@example.com>" or "foo@example.com".
-
*Header
Concrete Type v1.0A Header represents the key-value pairs in a mail message header.
-
*Message
Concrete Type v1.0A Message represents a parsed mail message.
-
Address
Concrete Type v1.0Address represents a single mail address.
An address such as "Barry Gibbs <bg@example.com>" is represented
as Address{Name: "Barry Gibbs", Address: "bg@example.com"}.
-
AddressParser
Concrete Type v1.0An AddressParser is an RFC 5322 address parser.
-
Header
Concrete Type v1.0A Header represents the key-value pairs in a mail message header.
-
AddressList
Receiver for Header v1.0([key])
AddressList parses the named header field as a list of addresses.
-
Date
Receiver for Header v1.0([])
Date parses the Date header field.
-
Get
Receiver for Header v1.0([key])
Get gets the first value associated with the given key.
It is case insensitive; CanonicalMIMEHeaderKey is used
to canonicalize the provided key.
If there are no values associated with the key, Get returns "".
To access multiple values of a key, or to use non-canonical keys,
access the map directly.
-
Message
Concrete Type v1.0A Message represents a parsed mail message.
-
arrayOfAddress
Concrete Type v1.0Address represents a single mail address.
An address such as "Barry Gibbs <bg@example.com>" is represented
as Address{Name: "Barry Gibbs", Address: "bg@example.com"}.
-
arrayOfAddressParser
Concrete Type v1.0An AddressParser is an RFC 5322 address parser.
-
arrayOfHeader
Concrete Type v1.0A Header represents the key-value pairs in a mail message header.
-
arrayOfMessage
Concrete Type v1.0A Message represents a parsed mail message.