The Horde_Mime_Mail:: class wraps around the various MIME library classes
to provide a simple interface for creating and sending MIME messages.
All content has to be passed UTF-8 encoded. The charset parameters is used
for the generated message only.
Copyright 2007-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.horde.org/licenses/lgpl21.
Methods summary
public
|
#
__construct( array $params = array() )
Constructor.
Parameters
- $params
- <p>A hash with basic message information. 'charset'
is the character set of the message. 'body' is
the message body. All other parameters are
assumed to be message headers.</p>
Throws
|
public
|
#
setBody( string $body, string $charset = null, boolean|integer $wrap = false )
Sets the message body text.
Sets the message body text.
Parameters
- $body
- The message content.
- $charset
- The character set of the message.
- $wrap
- <p>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.</p>
|
public
|
#
setHtmlBody( string $body, string $charset = null, boolean $alternative = true )
Sets the HTML message body text.
Sets the HTML message body text.
Parameters
- $body
- The message content.
- $charset
- The character set of the message.
- $alternative
- <p>If true, a multipart/alternative message is
created and the text/plain part is
generated automatically. If false, a
text/html message is generated.</p>
|
public
integer
|
#
addPart( string $mime_type, string $content, string $charset = 'us-ascii', string $disposition = null )
Adds a message part.
Parameters
- $mime_type
- The content type of the part.
- $content
- The content of the part.
- $charset
- The character set of the part.
- $disposition
- The content disposition of the part.
Returns
integer The part number.
|
public
integer
|
#
addMimePart( Horde_Mime_Part $part )
Adds a MIME message part.
Adds a MIME message part.
Parameters
- $part
- A Horde_Mime_Part object.
Returns
integer The part number.
|
public
|
#
setBasePart( Horde_Mime_Part $part )
Sets the base MIME part.
If the base part is set, any text bodies will be ignored when building
the message.
Parameters
- $part
- A Horde_Mime_Part object.
|
public
integer
|
#
addAttachment( string $file, string $name = null, string $type = null, string $charset = 'us-ascii' )
Adds an attachment.
Parameters
- $file
- The path to the file.
- $name
- The file name to use for the attachment.
- $type
- The content type of the file.
- $charset
- <p>The character set of the part (only relevant for
text parts.</p>
Returns
integer The part number.
|
public
|
#
removePart( integer $part )
Removes a message part.
Parameters
|
public
|
#
clearParts( )
Removes all (additional) message parts but leaves the body parts
untouched.
Removes all (additional) message parts but leaves the body parts
untouched.
Since
Horde_Mime 1.2.0
|
public
|
#
addRecipients( string|array $recipients )
Adds message recipients.
Recipients specified by To:, Cc:, or Bcc: headers are added
automatically.
Parameters
- $recipients
- <p>of recipients, either as a comma separated
list or as an array of email addresses.</p>
Throws
|
public
|
#
removeRecipients( string|array $recipients )
Removes message recipients.
Removes message recipients.
Parameters
- $recipients
- <p>of recipients, either as a comma separated
list or as an array of email addresses.</p>
Throws
|
public
|
#
clearRecipients( )
Removes all message recipients.
Removes all message recipients.
|
public
|
#
send( Mail $mailer, boolean $resend = false, boolean $flowed = true )
Sends this message.
Parameters
- $mailer
- A Mail object.
- $resend
- <p>If true, the message id and date are re-used;
If false, they will be updated.</p>
- $flowed
- Send message in flowed text format.
Throws
|