        Cone©

MAIL::HEADER::ENCODE(3x)

NAME
mail::Header::encoded - An unstructured E-mail header.

SYNOPSIS

#include <libmail/headers.H>
mail::Header::encoded encoded_header("Subject", subjectStr, "UTF-8", "EN");
std::cout << encoded_header.toString();

USAGE

This class creates unstructured E-mail header. Three arguments are provided to the constructor: the header's name, its content, and the content's character set. Non-US-ASCII portions of the contents are encoded according to RFC 2047[1].

The fourth argument to the constructor is optional. If not an empty string, it identifies the content's language, as described in section 5 of RFC 2231[2].

This is not the appropriate class to create structured MIME headers, or address list headers. Use mail::Header::addresslist(3x) to create headers that contain E-mail addresses. Use mail::Header::mime(3x) to create structured MIME headers.

The toString() returns the header as a single text string: “name: value”. Long headers are folded at the nearest whitespace.

SEE ALSO

mail::Header::addresslist(3x), mail::Header::list(3x), mail::Header::mime(3x), mail::Header::plain(3x).

AUTHOR

Sam Varshavchik

NOTES

1.  RFC 2047
    http://www.rfc-editor.org/rfc/rfc2047.txt

2.  RFC 2231
    http://www.rfc-editor.org/rfc/rfc2231.txt