172 list<hash<MessageInfo>>
part();
518 const MP_DEFAULT_MSG =
"This is a MIME multipart message";
532 list<hash<MessagePartInfo>> l();
654 static hash<MessageInfo>
parseBody(
string boundary, data body,
bool decode = True);
666 final hash<MessageInfo> getMsgAndHeadersIntern(*
string content_type,
bool conlen = True);
672 splicePartIntern(data mime_data, hash<auto> hdr);
678 addPartIntern(data mime_data, hash<auto> hdr);
683 static hash<MessagePartInfo> getPart(data mime_data, hash<auto> hdr);
715 splicePart(data mime_data,
string id,
string content_type, *hash<auto> hdr);
726 addPart(data mime_data,
string id,
string content_type, *hash hdr);
951 splicePart(data mime_data,
string name,
string filename,
string content_type, *hash hdr);
969 addPart(data mime_data,
string name, *hash hdr);
981 addPart(data mime_data,
string name,
string filename,
string content_type, *hash hdr);
1010 static hash<string, hash<FormDataMessageInfo>>
parseMessage(
string content,
string body);
1034 hash
getPartHeader(
string name, *
string filename, *
string content_type, *hash hdr);
implements the MultiPartAlternativeMessage class, a specialization of MultiPartMessage
Definition: Mime.qm.dox.h:826
spliceEncodePart(data mime_data, string enc, string content_type=MimeTypeText, string disp='inline', *hash< auto > hdr)
adds a message part to the start of the list; encodes the data according to the transfer encoding arg...
splicePart(data mime_data, string content_type=MimeTypeText, string disp='inline', *hash< auto > hdr)
adds a message part to the start of the list
addPart(data mime_data, string content_type=MimeTypeText, string disp='inline', *hash< auto > hdr)
adds a message part to the end of the list; the data muyst already be encoded and any Content-Transfe...
hash< MessageInfo > getMsgAndHeaders()
returns a hash of the message
constructor(string boundary=MultiPartMessage::getBoundary())
creates the object
addEncodePart(data mime_data, string enc, string content_type=MimeTypeText, string disp='inline', *hash< auto > hdr)
adds a message part to the end of the list; encodes the data according to the transfer encoding argum...
MultiPartMessage class implementation.
Definition: Mime.qm.dox.h:515
binary serializeBody()
serializes the message body only and returns a binary object ready to send over a socket
int size()
returns the number of parts in the message
binary serialize()
serializes the message with the Content-Type header first and returns a binary object ready to send o...
static hash< MessageInfo > parseBody(string boundary, data body, bool decode=True)
returns a hash representing a parsed multipart message body from a boundary string and body arguments
static binary serializeHeaders(hash hdr)
serializes a header hash to a binary object
abstract hash< MessageInfo > getMsgAndHeaders()
returns a hash of the message
static string getRandomString(int len)
returns a string of random characters
string getBoundary()
returns the message boundary string used
constructor(string mptype, string boundary=MultiPartMessage::getBoundary())
creates the object
static string getBoundary()
returns a string embedded with the current timestamp designed to be used as MultiPart boundary string
implements the MultiPartMixedMessage class, a specialization of MultiPartMessage
Definition: Mime.qm.dox.h:739
spliceEncodePart(data mime_data, string enc, string content_type=MimeTypeText, string disp='inline', *hash< auto > hdr)
adds a message part to the start of the list; encodes the data according to the transfer encoding arg...
splicePart(data mime_data, string content_type=MimeTypeText, string disp='inline', *hash< auto > hdr)
adds a message part to the start of the list; the data muyst already be encoded and any Content-Trans...
hash< MessageInfo > getMsgAndHeaders()
returns a hash of the message
addPart(data mime_data, string content_type=MimeTypeText, string disp='inline', *hash< auto > hdr)
adds a message part to the end of the list; the data muyst already be encoded and any Content-Transfe...
addEncodePart(data mime_data, string enc, string content_type=MimeTypeText, string disp='inline', *hash< auto > hdr)
adds a message part to the end of the list; encodes the data according to the transfer encoding argum...
constructor(string boundary=MultiPartMessage::getBoundary())
creates the object
const ContentTransEncBase64
base-64 Content-Transfer-Encoding
Definition: Mime.qm.dox.h:292
const ContentTransEncBinary
binary transfer encoding; implies no maximum line length (= no encoding)
Definition: Mime.qm.dox.h:289
const ContentTransEnc7Bit
Definition: Mime.qm.dox.h:283
const ContentTransEncQuotedPrintable
quoted-printable Content-Transfer-Encoding
Definition: Mime.qm.dox.h:295
const MimeBase64LineLen
maximum line length for base64 encoding
Definition: Mime.qm.dox.h:300
const MimeQuotedPrintableLineLen
maximum line length for quoted-printable encoding
Definition: Mime.qm.dox.h:305
const ContentTransEnc8Bit
implies lines < 1000 chars (= no encoding)
Definition: Mime.qm.dox.h:286
binary mime_decode_base64(data str)
data mime_decode_transfer_data(data mime_data, string enc, *string ct, *bool is_body)
decodes data according to the given encoding
string mime_decode_header(string hdr)
decodes a header string
string mime_decode_quoted_printable(string str, *string encoding, *bool is_body)
returns a string parsed from "quoted-printable" (or "QP") encoding
string mime_decode_base64_to_string(data str, *string encoding)
returns a string value from a string in "BASE64" encoding
string mime_encode_header_word_b(string str)
returns a string in "B" ("BASE64") encoding for MIME header string words
string mime_encode_quoted_printable(string str, bool hdr=False, *string encoding)
returns a string in "quoted-printable" (or "QP") encoding
data mime_encode_transfer_data(data mime_data, string enc)
encodes data according to the given encoding
string mime_encode_header_word_q(string str)
returns a string in "Q" ("quoted-printable") encoding for MIME header string words
string mime_encode_base64(data str, int len=MimeBase64LineLen)
string get_mime_type_from_ext(string path, string def_type=MimeTypeUnknown)
string mime_get_form_urlencoded_string(hash h)
returns a string in MIME multipart form URL encoded format (for use with "Content-Type: application/x...
string mime_decode_urlencoded_string(string str)
decodes the given string from URL encoded format
string mime_get_urlencoded_string(auto val)
returns a single string in MIME URL encoded format
hash< auto > mime_parse_form_urlencoded_string(string str)
returns a hash corresponding to the string in MIME multipart form URL encoded format (for use with "C...
const MimeTypeMultipartRelated
Mime type for multipart related.
Definition: Mime.qm.dox.h:257
const MimeTypeJavascript
Mime type for Javascript.
Definition: Mime.qm.dox.h:245
const UrlEncodedChars
hash of non-alphanumeric characters that can be used unencoded in URL encoded format
Definition: Mime.qm.dox.h:275
const MimeTypeMultipartFormData
Mime type for multipart form data.
Definition: Mime.qm.dox.h:254
const MimeTypeUnknown
Definition: Mime.qm.dox.h:200
const MimeTypePng
MIME type for png images.
Definition: Mime.qm.dox.h:218
const MimeTypeFormUrlEncoded
Mime type for multipart form URL encoding.
Definition: Mime.qm.dox.h:251
const MimeTypeText
MIME type for text.
Definition: Mime.qm.dox.h:206
const MimeTypes
A map of default mime types per file extension; the hash keys are file extensions in lower-case witho...
Definition: Mime.qm.dox.h:265
const MimeTypeCsv
MIME type for csv files (http://tools.ietf.org/html/rfc4180)
Definition: Mime.qm.dox.h:212
const MimeTypeHtml
MIME type for HTML.
Definition: Mime.qm.dox.h:209
const MimeTypeXmlApp
Mime type for more complicated (not human-readable) xml files.
Definition: Mime.qm.dox.h:230
const MimeTypeJsonRpc
Mime type for JSON-RPC.
Definition: Mime.qm.dox.h:236
const MimeTypeOctetStream
MIME type for unknown file types.
Definition: Mime.qm.dox.h:203
const MimeTypeXml
Mime type for plain (human-readable) xml files.
Definition: Mime.qm.dox.h:227
const MimeTypeMultipartMixed
Mime type for multipart mixed.
Definition: Mime.qm.dox.h:260
const MimeTypeSoapXml
Mime type for SOAP XML messages (XML MIME type reference: http://tools.ietf.org/html/rfc3023)
Definition: Mime.qm.dox.h:221
const MimeTypeYaml
Mime type for yaml data files.
Definition: Mime.qm.dox.h:224
const MimeTypeYamlRpc
Mime type for YAML-RPC.
Definition: Mime.qm.dox.h:242
const MimeTypeJpeg
MIME type for jpeg images.
Definition: Mime.qm.dox.h:215
const MimeTypeXmlRpc
Mime type for XML-RPC.
Definition: Mime.qm.dox.h:239
const MimeTypeCss
Mime type for css.
Definition: Mime.qm.dox.h:248
const MimeTypeJson
Mime type for JSON.
Definition: Mime.qm.dox.h:233
const MPT_DIGEST
for sending multiple text messages (http://tools.ietf.org/html/rfc2046#section-5.1....
Definition: Mime.qm.dox.h:496
const MPT_SIGNED
to attach a digital signature to a message (http://tools.ietf.org/html/rfc1847#section-2....
Definition: Mime.qm.dox.h:505
const MPT_ENCRYPTED
for sending encrypted messages (http://tools.ietf.org/html/rfc1847#section-2.2)
Definition: Mime.qm.dox.h:508
const MPT_MIXED
for sending files with different "Content-Type" headers (http://tools.ietf.org/html/rfc2046#section-5...
Definition: Mime.qm.dox.h:490
const MPT_RELATED
for sending multiple components of an aggregated whole (http://tools.ietf.org/html/rfc2387)
Definition: Mime.qm.dox.h:502
const MPT_BYTERANGES
for sending noncontiguous byte ranges of a single message (http://tools.ietf.org/html/rfc2616)
Definition: Mime.qm.dox.h:511
const MPT_ALTERNATIVE
for sending multiple "alternatives" of the same content (http://tools.ietf.org/html/rfc2046#section-5...
Definition: Mime.qm.dox.h:499
const MPT_FORM_DATA
Definition: Mime.qm.dox.h:487
const MPT_MESSAGE
for email/MIME messages with headers (http://tools.ietf.org/html/rfc2046)
Definition: Mime.qm.dox.h:493
public Mime namespace defines constants and functions relevant to MIME
Definition: Mime.qm.dox.h:162
message and part info hash
Definition: Mime.qm.dox.h:166
hash hdr
message or part headers
Definition: Mime.qm.dox.h:168
data body
the data for the message or part
Definition: Mime.qm.dox.h:170
list< hash< MessageInfo > > part()
parts of the message or subparts of the part
message part hash
Definition: Mime.qm.dox.h:176
data data
part body data
Definition: Mime.qm.dox.h:178
hash hdr
part header hash
Definition: Mime.qm.dox.h:180