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.
Adds an attachment.
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.
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.
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
Adds a MIME message part.
Adds a message part.
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.
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.
Removes all message recipients.
void
clearRecipients
()
Removes a message header.
void
removeHeader
(string $header)
-
string
$header: The header name.
Removes a message part.
void
removePart
(integer $part)
-
integer
$part: The part number.
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.
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
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.
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.
Builds a recipients list.
array
_buildRecipients
(string|array $recipients)
-
string|array
$recipients: List of recipients, either as a comma separated list or as an array of email addresses.