Class MIME_Mail

Description

The MIME_Mail:: class wraps around the various MIME library classes to provide a simple interface for creating and sending MIME messages.

$Horde: framework/MIME/MIME/Mail.php,v 1.8.2.7 2009/01/06 15:23:20 jan Exp $

Copyright 2007-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /MIME/MIME/Mail.php (line 24)


	
			
Variable Summary
Method Summary
 MIME_Mail MIME_Mail ([string $subject = null], [string $body = null], [string $to = null], [string $from = null], [string $charset = null])
 integer addAttachment (string $file, [string $name = null], [string $type = null], [string $charset = 'us-ascii'])
 void addHeader (string $header, string $value, [string $charset = null], [boolean $overwrite = null])
 void addHeaders ([ $headers = array()], [string $charset = null], array $header)
 integer addMIMEPart (MIME_Part $part)
 integer addPart (string $mime_type, string $content, [string $charset = 'us-ascii'], [string $disposition = null])
 void addRecipients (string|array $recipients)
 void clearRecipients ()
 void removeHeader (string $header)
 void removePart (integer $part)
 void removeRecipients (string|array $recipients)
 mixed send ([string $driver = null], [array $params = array()], [boolean $resend = false], [boolean $flowed = true])
 void setBody (string $body, [string $charset = 'iso-8859-1'], [boolean|integer $wrap = false])
 void setHTMLBody (string $body, [string $charset = 'iso-8859-1'], [boolean $alternative = true])
 array _buildRecipients (string|array $recipients)
Variables
MIME_Part $_body (line 38)

The main body part.

MIME_Headers $_headers (line 31)

The message headers.

MIME_Part $_htmlBody (line 45)

The main HTML body part.

string $_mailer_driver = 'smtp' (line 67)

The Mail driver name.

array $_mailer_params = array() (line 75)

The Mail driver parameters.

array $_parts = array() (line 59)

All MIME parts except the main body part.

array $_recipients = array() (line 52)

The message recipients.

Methods
Constructor MIME_Mail (line 86)

Constructor.

MIME_Mail MIME_Mail ([string $subject = null], [string $body = null], [string $to = null], [string $from = null], [string $charset = null])
  • string $subject: The message subject.
  • string $body: The message body.
  • string $to: The message recipient(s).
  • string $from: The message sender.
  • string $charset: The character set of the message.
addAttachment (line 285)

Adds an attachment.

  • return: The part number.
integer addAttachment (string $file, [string $name = null], [string $type = null], [string $charset = 'us-ascii'])
  • string $file: The path to the file.
  • string $name: The file name to use for the attachment.
  • string $type: The content type of the file.
  • string $charset: The character set of the part (only relevant for text parts.
addHeader (line 145)

Adds a message header.

void addHeader (string $header, string $value, [string $charset = null], [boolean $overwrite = null])
  • string $header: The header name.
  • string $value: The header value.
  • string $charset: The header value's charset.
  • boolean $overwrite: If true, an existing header of the same name is being overwritten; if false, multiple headers are added; if null, the correct behaviour is automatically chosen depending on the header name.
addHeaders (line 122)

Adds several message headers at once.

void addHeaders ([ $headers = array()], [string $charset = null], array $header)
  • array $header: Hash with header names as keys and header contents as values.
  • string $charset: The header value's charset.
  • $headers
addMIMEPart (line 267)

Adds a MIME message part.

  • return: The part number.
integer addMIMEPart (MIME_Part $part)
addPart (line 251)

Adds a message part.

  • return: The part number.
integer addPart (string $mime_type, string $content, [string $charset = 'us-ascii'], [string $disposition = null])
  • string $mime_type: The content type of the part.
  • string $content: The content of the part.
  • string $charset: The character set of the part.
  • string $disposition: The content disposition of the part.
addRecipients (line 324)

Adds message recipients.

Recipients specified by To:, Cc:, or Bcc: headers are added automatically.

void addRecipients (string|array $recipients)
  • string|array $recipients: List of recipients, either as a comma separated list or as an array of email addresses.
clearRecipients (line 351)

Removes all message recipients.

void clearRecipients ()
removeHeader (line 191)

Removes a message header.

void removeHeader (string $header)
  • string $header: The header name.
removePart (line 308)

Removes a message part.

void removePart (integer $part)
  • integer $part: The part number.
removeRecipients (line 339)

Removes message recipients.

void removeRecipients (string|array $recipients)
  • string|array $recipients: List of recipients, either as a comma separated list or as an array of email addresses.
send (line 409)

Sends this message.

For the possible Mail drivers and parameters see the PEAR Mail documentation.

mixed send ([string $driver = null], [array $params = array()], [boolean $resend = false], [boolean $flowed = true])
  • string $driver: The Mail driver to use.
  • array $params: Any parameters necessary for the Mail driver.
  • boolean $resend: If true, the message id and date are re-used; If false, they will be updated.
  • boolean $flowed: Send message in flowed text format. @since Horde 3.2.1
setBody (line 210)

Sets the message body text.

void setBody (string $body, [string $charset = 'iso-8859-1'], [boolean|integer $wrap = false])
  • string $body: The message content.
  • string $charset: The character set of the message.
  • boolean|integer $wrap: If true, wrap the message at column 76; If an integer wrap the message at that column. Don't use wrapping if sending flowed messages.
setHTMLBody (line 231)

Sets the HTML message body text.

void setHTMLBody (string $body, [string $charset = 'iso-8859-1'], [boolean $alternative = true])
  • string $body: The message content.
  • string $charset: The character set of the message.
  • boolean $alternative: If true, a multipart/alternative message is created and the text/plain part is generated automatically. If false, a text/html message is generated.
_buildRecipients (line 364)

Builds a recipients list.

  • return: Normalized list of recipients or PEAR_Error on failure.
array _buildRecipients (string|array $recipients)
  • string|array $recipients: List of recipients, either as a comma separated list or as an array of email addresses.

Documentation generated on Sun, 30 Jan 2011 05:19:24 +0000 by phpDocumentor 1.4.3