Qore Mime Module Reference 1.6
Loading...
Searching...
No Matches
Mime::MultiPartAlternativeMessage Class Reference

implements the MultiPartAlternativeMessage class, a specialization of MultiPartMessage More...

#include <Mime.qm.dox.h>

Inheritance diagram for Mime::MultiPartAlternativeMessage:
[legend]

Public Member Methods

 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 argument passed
 
 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-Transfer-Encoding header must already be present in hdr
 
 constructor (string boundary=MultiPartMessage::getBoundary())
 creates the object
 
hash< MessageInfogetMsgAndHeaders ()
 returns a hash of the message
 
 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 argument passed
 
 splicePart (data mime_data, string content_type=MimeTypeText, string disp='inline', *hash< auto > hdr)
 adds a message part to the start of the list
 
- Public Member Methods inherited from Mime::MultiPartMessage
 constructor (string mptype, string boundary=MultiPartMessage::getBoundary())
 creates the object
 
string getBoundary ()
 returns the message boundary string used
 
abstract hash< MessageInfogetMsgAndHeaders ()
 returns a hash of the message
 
binary serialize ()
 serializes the message with the Content-Type header first and returns a binary object ready to send over a socket
 
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
 

Additional Inherited Members

- Static Public Member Methods inherited from Mime::MultiPartMessage
static string getBoundary ()
 returns a string embedded with the current timestamp designed to be used as MultiPart boundary string
 
static string getRandomString (int len)
 returns a string of random characters
 
static hash< MessageInfoparseBody (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
 

Detailed Description

implements the MultiPartAlternativeMessage class, a specialization of MultiPartMessage

Member Function Documentation

◆ addEncodePart()

Mime::MultiPartAlternativeMessage::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 argument passed

Parameters
mime_datathe unencoded data for the part
encthe transfer encoding to use for the part; see MIME Content Transfer Encoding Constants for possible values
content_typethe content_type for the part
dispthe Content-Disposition header (ex: 'inline', 'attachment; filename="file.txt"')
hdran optional hash of headers for the part
Exceptions
MIME-TRANSFER-ENCODING-ERRORunknown transfer encoding
PART-ERRORempty content type argument passed
See also

◆ addPart()

Mime::MultiPartAlternativeMessage::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-Transfer-Encoding header must already be present in hdr

Parameters
mime_datathe data for the part
content_typethe content_type for the part
dispthe Content-Disposition header (ex: 'inline', 'attachment; filename="file.txt"')
hdran optional hash of headers for the part
Exceptions
PART-ERRORempty content type argument passed
See also

◆ constructor()

Mime::MultiPartAlternativeMessage::constructor ( string  boundary = MultiPartMessage::getBoundary())

creates the object

Parameters
boundarythe boundary to use between parts

◆ getMsgAndHeaders()

hash< MessageInfo > Mime::MultiPartAlternativeMessage::getMsgAndHeaders ( )

returns a hash of the message

Returns
a hash of the message with the following keys:
  • hdr: a hash of header information
  • body: a binary object of serialized message parts

◆ spliceEncodePart()

Mime::MultiPartAlternativeMessage::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 argument passed

Parameters
mime_datathe unencoded data for the part
encthe transfer encoding to use for the part; see MIME Content Transfer Encoding Constants for possible values
content_typethe content_type for the part
dispthe Content-Disposition header (ex: 'inline', 'attachment; filename="file.txt"')
hdran optional hash of headers for the part
Exceptions
MIME-TRANSFER-ENCODING-ERRORunknown transfer encoding
PART-ERRORempty content type argument passed
See also

◆ splicePart()

Mime::MultiPartAlternativeMessage::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 must already be encoded and any Content-Transfer-Encoding header must already be present in hdr

Parameters
mime_datathe data for the part
content_typethe content_type for the part
dispthe Content-Disposition header (ex: 'inline', 'attachment; filename="file.txt"')
hdran optional hash of headers for the part
Exceptions
PART-ERRORempty content type argument passed
See also