Mailinglist
 All Data Structures Files Functions Variables Pages
Public Member Functions | Data Fields
MailinglistMessage Class Reference

Class defining the contents of an e-mail message. More...

Inheritance diagram for MailinglistMessage:
Inheritance graph
[legend]
Collaboration diagram for MailinglistMessage:
Collaboration graph
[legend]

Public Member Functions

 __construct ($msg="")
 __construct() More...
 
 raw ()
 Get contents of raw message. More...
 
- Public Member Functions inherited from MailinglistMessagePart
 headerRaw ($name)
 headerRaw(). More...
 
 header ($name)
 header() More...
 
 headerEmail ($name)
 Return header parsed as an email address into an array with indexes email and name. More...
 
 headerNoComments ($name)
 
 addHeader ($header_name, $header_value)
 Add a given header to the message, if header already exists, add as an array. More...
 
 setHeader ($header_name, $header_value)
 Set a header to a given value. More...
 
 body ()
 Return the body of the message. More...
 
 headers ()
 Return array of all headers. More...
 
 __construct ($msg=NULL)
 Build an message part. More...
 
 parseHeaders ()
 parseHeaders() Converts the headers member from a single text string with the contents of the part (or message) headers to an associtive array of the headers. More...
 
 parseBody ()
 parseBody()) converts text string in the body variable into a processed body For MIME type multipart, the body will become an array of the sections For MIME type message/rfc822, the body will become a MailingMessage object More...
 
 parseEmailAddr ($addr)
 Parse an Email address. More...
 
 stripComments ($header)
 
 logError ($str, $parm=array())
 logError() More...
 
- Public Member Functions inherited from MailinglistMessageInterface
 header ($name)
 

Data Fields

 $raw_message
 
- Data Fields inherited from MailinglistMessagePart
 $headers
 An array of the headers of the message part Header name is the index to the array. More...
 
 $body
 The body of the message, if it is a multi-part then it is an array of the various multi-parts. More...
 

Detailed Description

Class defining the contents of an e-mail message.

The differnce between a MailinglistMessage and a MailinglistMessagePart is that a MailinglistMessage represents a "full" RFC822 message, with all the email headers, while a MailinglistMessagePart (when not also a MailinglistMessage) represents just a MIME block with restricted header infomation.

Definition at line 678 of file MailinglistMessage.class.php.

Constructor & Destructor Documentation

__construct (   $msg = "")

__construct()

Build a MailinglistMessage

Parameters
$msgA string containing the contents of the message (includng headers).

Implements MailinglistMessageInterface.

Definition at line 688 of file MailinglistMessage.class.php.

References MailinglistMessagePart\setHeader().

688  {
689  if (is_string($msg)) {
690  // Fix line endings, just in case
691  $msg = str_replace(array("\n\r", "\r\n", "\r"), "\n", $msg);
692  // Build up our best conversion of raw message. Problem is it may have a mixed encoding
693  $rawmsg = @iconv('UTF-8//IGNORE', 'UTF-8', $msg);
694  $charset="";
695  if ($rawmsg != $msg) {
696  $rawmsg = iconv('ISO-8859-1//IGNORE', 'UTF-8', $msg);
697  $charset = 'ISO-8859-1';
698  }
699  $this->raw_message = $rawmsg;
700  parent::__construct($msg);
701  if(!empty($charset)){
702  $this->setHeader('XX-RawCharset', $charset);
703  }
704  }
705  }
setHeader($header_name, $header_value)
Set a header to a given value.

Here is the call graph for this function:

Member Function Documentation

raw ( )

Get contents of raw message.

Returns
string: The raw message body.

Definition at line 712 of file MailinglistMessage.class.php.

References $raw_message.

712  {
713  return $this->raw_message;
714  }

Field Documentation

$raw_message

Definition at line 679 of file MailinglistMessage.class.php.

Referenced by raw().


The documentation for this class was generated from the following file: