Methods summary
public
|
#
__construct( string $cacheid )
Constructor.
Parameters
- $cacheid
- The cache ID string.
|
public
|
#
__wakeup( )
Tasks to do upon unserialize().
Tasks to do upon unserialize().
|
public
|
#
destroy( string $action )
Destroys an IMP_Compose instance.
Destroys an IMP_Compose instance.
Parameters
- $action
- <p>The action performed to cause the end of this
instance. Either 'cancel', 'discard',
'save_draft', or 'send'.</p>
|
public
mixed
|
#
getMetadata( string $name )
Gets metadata about the current object.
Gets metadata about the current object.
Parameters
Returns
mixed The metadata value or null if it doesn't exist.
|
public
string
|
#
saveDraft( array $headers, mixed $message, array $opts = array() )
Saves a draft message.
Parameters
- $headers
- List of message headers (UTF-8).
- $message
- <p>Either the message text (string) or a
Horde_Mime_Part object that contains the text
to send.</p>
- $opts
- <p>An array of options w/the following keys:
- autosave: (boolean) Is this an auto-saved draft?
- html: (boolean) Is this an HTML message?
- priority: (string) The message priority ('high', 'normal', 'low').
- readreceipt: (boolean) Add return receipt headers?</p>
Returns
string Notification text on success (not HTML encoded).
Throws
|
public
mixed
|
#
editAsNew( IMP_Indices $indices, array $opts = array() )
Edits a message as new.
Parameters
- $indices
- An indices object.
- $opts
- <p>Additional options:
- format: (string) Force to this format.
DEFAULT: Auto-determine.</p>
Returns
mixed See resumeDraft().
Throws
See
resumeDraft().
|
public
mixed
|
#
editTemplate( IMP_Indices $indices )
Edit an existing template message. Saving this template later
(using saveTemplate()) will cause the original message to be deleted.
Edit an existing template message. Saving this template later
(using saveTemplate()) will cause the original message to be deleted.
Parameters
- $indices
- An indices object.
Returns
mixed See resumeDraft().
Throws
|
public
mixed
|
#
resumeDraft( IMP_Indices $indices, array $opts = array() )
Resumes a previously saved draft message.
Resumes a previously saved draft message.
Parameters
- $indices
- An indices object.
- $opts
- <p>Additional options:
- format: (string) Force to this format.
DEFAULT: Auto-determine.</p>
Returns
mixed An array with the following keys:
- addr: (array) Address lists (to, cc, bcc; Horde_Mail_Rfc822_List
objects).
- body: (string) The text of the body part.
- format: (string) The format of the body message ('html', 'text').
- identity: (mixed) See IMP_Prefs_Identity#getMatchingIdentity().
- priority: (string) The message priority.
- readreceipt: (boolean) Add return receipt headers?
- subject: (string) Formatted subject.
- type: (integer) - The compose type.
Throws
|
public
mixed
|
#
useTemplate( IMP_Indices $indices, array $opts = array() )
Uses a template to create a message.
Uses a template to create a message.
Parameters
- $indices
- An indices object.
- $opts
- <p>Additional options:
- format: (string) Force to this format.
DEFAULT: Auto-determine.</p>
Returns
mixed See resumeDraft().
Throws
See
resumeDraft().
|
public
string
|
#
saveTemplate( array $headers, mixed $message, array $opts = array() )
Save a template message on the IMAP server.
Save a template message on the IMAP server.
Parameters
- $headers
- List of message headers (UTF-8).
- $message
- <p>Either the message text (string) or a
Horde_Mime_Part object that contains the text
to save.</p>
- $opts
- <p>An array of options w/the following keys:
- html: (boolean) Is this an HTML message?
- priority: (string) The message priority ('high', 'normal', 'low').
- readreceipt: (boolean) Add return receipt headers?</p>
Returns
string Notification text on success.
Throws
|
public
boolean
|
#
hasDrafts( )
Does this message have any drafts associated with it?
Does this message have any drafts associated with it?
Returns
boolean True if draft messages exist.
|
public
|
#
buildAndSendMessage( string $body, array $header, IMP_Prefs_Identity $identity, array $opts = array() )
Builds and sends a MIME message.
Builds and sends a MIME message.
Parameters
- $body
- The message body.
- $header
- List of message headers.
- $identity
- <p>The Identity object for the sender
of this message.</p>
- $opts
- <p>An array of options w/the
following keys:
- encrypt: (integer) A flag whether to encrypt or sign the message.
One of:
- IMP_Crypt_Pgp::ENCRYPT</li>
- IMP_Crypt_Pgp::SIGNENC</li>
- IMP_Crypt_Smime::ENCRYPT</li>
- IMP_Crypt_Smime::SIGNENC</li>
- html: (boolean) Whether this is an HTML message.
DEFAULT: false
- pgp_attach_pubkey: (boolean) Attach the user's PGP public key to the
message?
- priority: (string) The message priority ('high', 'normal', 'low').
- save_sent: (boolean) Save sent mail?
- sent_mail: (IMP_Mailbox) The sent-mail mailbox (UTF-8).
- strip_attachments: (bool) Strip attachments from the message?
- signature: (string) The message signature.
- readreceipt: (boolean) Add return receipt headers?
- useragent: (string) The User-Agent string to use.
- vcard_attach: (string) Attach the user's vCard (value is name to
display as vcard filename).</p>
Throws
|
public
|
#
sendMessage( Horde_Mail_Rfc822_List $email, Horde_Mime_Headers $headers, Horde_Mime_Part $message )
Sends a message.
Parameters
- $email
- The e-mail list to send to.
- $headers
- <p>The object holding this message's
headers.</p>
- $message
- <p>The object that contains the text
to send.</p>
Throws
|
public
|
#
_saveRecipients( Horde_Mail_Rfc822_List $recipients )
Save the recipients done in a sendMessage().
Save the recipients done in a sendMessage().
Parameters
- $recipients
- The list of recipients.
|
public
array
|
#
recipientList( array $hdr )
Cleans up and returns the recipient list. Method designed to parse
user entered data; does not encode/validate addresses.
Cleans up and returns the recipient list. Method designed to parse
user entered data; does not encode/validate addresses.
Parameters
- $hdr
- <p>An array of MIME headers and/or address list
objects. Recipients will be extracted from the 'to',
'cc', and 'bcc' entries.</p>
Returns
array An array with the following entries:
- has_input: (boolean) True if at least one of the headers contains
user input.
- header: (array) Contains the cleaned up 'to', 'cc', and 'bcc'
address list (Horde_Mail_Rfc822_List objects).
- list: (Horde_Mail_Rfc822_List) Recipient addresses.
|
public
array
|
#
replyMessage( integer $type, IMP_Contents $contents, array $opts = array() )
Determines the reply text and headers for a message.
Determines the reply text and headers for a message.
Parameters
- $type
- The reply type (self::REPLY* constant).
- $contents
- An IMP_Contents object.
- $opts
- <p>Additional options:
- format: (string) Force to this format.
DEFAULT: Auto-determine.
- to: (string) The recipient of the reply. Overrides the
automatically determined value.</p>
Returns
array An array with the following keys:
- addr: (array) Address lists (to, cc, bcc; Horde_Mail_Rfc822_List
objects).
- body: (string) The text of the body part.
- format: (string) The format of the body message (html, text).
- identity: (integer) The identity to use for the reply based on the
original message's addresses.
- lang: (array) Language code (keys)/language name (values) of the
original sender's preferred language(s).
- reply_list_id: (string) List ID label.
- reply_recip: (integer) Number of recipients in reply list.
- subject: (string) Formatted subject.
- type: (integer) The reply type used (either self::REPLY_ALL,
self::REPLY_LIST, or self::REPLY_SENDER).
Throws
|
public
array
|
#
replyMessageText( IMP_Contents $contents, array $opts = array() )
Returns the reply text for a message.
Returns the reply text for a message.
Parameters
- $contents
- An IMP_Contents object.
- $opts
- <p>Additional options:
- format: (string) Force to this format.
DEFAULT: Auto-determine.</p>
Returns
array An array with the following keys:
- body: (string) The text of the body part.
- charset: (string) The guessed charset to use for the reply.
- format: (string) The format of the body message ('html', 'text').
|
public
array
|
#
forwardMessage( integer $type, IMP_Contents $contents, boolean $attach = true, array $opts = array() )
Determine the text and headers for a forwarded message.
Determine the text and headers for a forwarded message.
Parameters
- $type
- <p>The forward type (self::FORWARD*
constant).</p>
- $contents
- An IMP_Contents object.
- $attach
- Attach the forwarded message?
- $opts
- <p>Additional options:
- format: (string) Force to this format.
DEFAULT: Auto-determine.</p>
Returns
array An array with the following keys:
- attach: (boolean) True if original message was attached.
- body: (string) The text of the body part.
- format: (string) The format of the body message ('html', 'text').
- identity: (mixed) See IMP_Prefs_Identity#getMatchingIdentity().
- subject: (string) Formatted subject.
- title: (string) Title to use on page.
- type: (integer) - The compose type.
Throws
|
public
array
|
#
forwardMessageText( IMP_Contents $contents, array $opts = array() )
Returns the forward text for a message.
Returns the forward text for a message.
Parameters
- $contents
- An IMP_Contents object.
- $opts
- <p>Additional options:
- format: (string) Force to this format.
DEFAULT: Auto-determine.</p>
Returns
array An array with the following keys:
- body: (string) The text of the body part.
- charset: (string) The guessed charset to use for the forward.
- format: (string) The format of the body message ('html', 'text').
|
public
array
|
#
forwardMultipleMessages( IMP_Indices $indices )
Prepares a forwarded message using multiple messages.
Prepares a forwarded message using multiple messages.
Parameters
- $indices
- <p>An indices object containing the indices
of the forwarded messages.</p>
Returns
array An array with the following keys:
- body: (string) The text of the body part.
- format: (string) The format of the body message ('html', 'text').
- identity: (mixed) See IMP_Prefs_Identity#getMatchingIdentity().
- subject: (string) Formatted subject.
- title: (string) Title to use on page.
- type: (integer) The compose type.
|
public
|
#
redirectMessage( IMP_Indices $indices )
Prepare a redirect message.
Prepare a redirect message.
Parameters
- $indices
- An indices object.
|
public
array
|
#
sendRedirectMessage( mixed $to, boolean $log = true )
Send a redirect (a/k/a resent) message. See RFC 5322 [3.6.6].
Send a redirect (a/k/a resent) message. See RFC 5322 [3.6.6].
Parameters
- $to
- The addresses to redirect to.
- $log
- <p>Whether to log the resending in the history and
sentmail log.</p>
Returns
array An object with the following properties for each
redirected message:
- contents: (IMP_Contents) The contents object.
- headers: (Horde_Mime_Headers) The header object.
- mbox: (IMP_Mailbox) Mailbox of the message.
- uid: (string) UID of the message.
Throws
|
public
string
|
#
attachImapMessage( IMP_Indices $indices )
Add mail message(s) from the mail server as a message/rfc822
attachment.
Add mail message(s) from the mail server as a message/rfc822
attachment.
Parameters
- $indices
- An indices object.
Returns
string Subject string.
Throws
|
public
|
#
addRelatedAttachment( IMP_Compose_Attachment $atc_ob, DOMElement $node, string $attribute )
Add an attachment referred to in a related part.
Add an attachment referred to in a related part.
Parameters
- $atc_ob
- $act_ob Attachment data.
- $node
- <p>Node element containg the
related reference.</p>
- $attribute
- <p>Element attribute containing the
related reference.</p>
|
public
|
|
public
string
|
#
getCacheId( )
Obtains the cache ID for the session object.
Obtains the cache ID for the session object.
Returns
string The message cache ID.
|
public
string
|
#
getHmac( string $cacheid = null, string $user = null )
Generate HMAC hash used to validate data on a session expiration. Uses
the unique compose cache ID of the expired message, the username, and
the secret key of the server to generate a reproducible value that can
be validated if session data doesn't exist.
Generate HMAC hash used to validate data on a session expiration. Uses
the unique compose cache ID of the expired message, the username, and
the secret key of the server to generate a reproducible value that can
be validated if session data doesn't exist.
Parameters
- $cacheid
- <p>The cache ID to use. If null, uses cache ID of
the compose object.</p>
- $user
- <p>The user ID to use. If null, uses the current
authenticated username.</p>
Returns
string The HMAC hash string.
|
public
mixed
|
#
additionalAttachmentsAllowed( )
How many more attachments are allowed?
How many more attachments are allowed?
Returns
mixed Returns true if no attachment limit.
Else returns the number of additional attachments
allowed.
|
public
integer
|
#
maxAttachmentSize( )
What is the maximum attachment size?
What is the maximum attachment size?
Returns
integer The maximum attachment size (in bytes).
|
public
Horde_Url
|
#
_getMessageTextCallback( mixed $id, mixed $attribute, mixed $node )
Callback used in _getMessageText().
Callback used in _getMessageText().
Returns
Horde_Url
|
public
IMP_Compose_Attachment
|
#
addAttachmentFromPart( Horde_Mime_Part $part )
Adds an attachment from Horde_Mime_Part data.
Adds an attachment from Horde_Mime_Part data.
Parameters
- $part
- <p>The object that contains the attachment
data.</p>
Returns
Throws
|
public
array
|
#
addAttachmentFromUpload( string $field )
Add attachment from uploaded (form) data.
Add attachment from uploaded (form) data.
Parameters
- $field
- The form field name.
Returns
array A list of IMP_Compose_Attachment objects (if
successfully attached) or IMP_Compose_Exception objects
(if error when attaching).
Throws
|
public
|
#
sessionExpireDraft( Horde_Variables $vars )
Store draft compose data if session expires.
Store draft compose data if session expires.
Parameters
- $vars
- Object with the form data.
|
public
|
|
public
mixed
|
#
getContentsOb( )
If this object contains sufficient metadata, return an IMP_Contents
object reflecting that metadata.
If this object contains sufficient metadata, return an IMP_Contents
object reflecting that metadata.
Returns
mixed Either an IMP_Contents object or null.
|
public
string
|
#
replyType( boolean $base = false )
Return the reply type.
Parameters
- $base
- Return the base reply type?
Returns
string The reply type, or null if not a reply.
|
public static
boolean
|
#
canCompose( )
Is composing messages allowed?
Is composing messages allowed?
Returns
boolean True if compose allowed.
Throws
Horde_Exception
|
public static
boolean
|
#
canUploadAttachment( )
Can attachments be uploaded?
Can attachments be uploaded?
Returns
boolean True if attachments can be uploaded.
|
public static
string
|
#
text2html( string $msg )
Shortcut function to convert text -> HTML for purposes of composition.
Shortcut function to convert text -> HTML for purposes of composition.
Parameters
Returns
string HTML text.
|
public
|
#
offsetExists( mixed $offset )
Implementation of
ArrayAccess::offsetExists()
|
public
|
#
offsetGet( mixed $offset )
Implementation of
ArrayAccess::offsetGet()
|
public
|
#
offsetSet( mixed $offset, mixed $value )
Implementation of
ArrayAccess::offsetSet()
|
public
|
#
offsetUnset( mixed $offset )
Implementation of
ArrayAccess::offsetUnset()
|
public
|
#
__toString( )
String representation: the cache ID.
String representation: the cache ID.
|
public
integer
|
#
count( )
Returns the number of attachments currently in this message.
Returns the number of attachments currently in this message.
Returns
integer The number of attachments in this message.
Implementation of
Countable::count()
|
public
|
#
getIterator( )
Implementation of
IteratorAggregate::getIterator()
|