Methods summary
public
|
#
__construct( string $cacheid )
Constructor.
Parameters
- $cacheid
- The cache ID string.
|
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', '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 message to the draft folder.
Saves a message to the draft folder.
Parameters
- $headers
- $header 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:
- 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
|
#
resumeDraft( IMP_Indices $indices, boolean $addheaders = true )
Resumes a previously saved draft message.
Resumes a previously saved draft message.
Parameters
- $indices
- An indices object.
- $addheaders
- Populate header entries?
Returns
mixed An array with the following keys:
- header: (array) A list of headers to add to the outgoing message.
- identity: (integer) The identity used to create the message.
- mode: (string) 'html' or 'text'.
- msg: (string) The message text.
- priority: (string) The message priority.
- readreceipt: (boolean) Add return receipt headers?
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
boolean
|
#
buildAndSendMessage( string $body, array $header, 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.
- $opts
- An array of options w/the following keys:
<ul>
<li>
encrypt: (integer) A flag whether to encrypt or sign the message.
One of:
<ul>
<li>IMP_Crypt_Pgp::ENCRYPT</li>
<li>IMP_Crypt_Pgp::SIGNENC</li>
<li>IMP_Crypt_Smime::ENCRYPT</li>
<li>IMP_Crypt_Smime::SIGNENC</li>
</ul>
</li>
<li>
html: (boolean) Whether this is an HTML message.
DEFAULT: false
</li>
<li>
identity: (IMP_Prefs_Identity) If set, checks for proper tie-to
addresses.
</li>
<li>
priority: (string) The message priority ('high', 'normal', 'low').
</li>
<li>
save_sent: (boolean) Save sent mail?
</li>
<li>
sent_folder: (IMP_Mailbox) The sent-mail folder (UTF7-IMAP).
</li>
<li>
save_attachments: (bool) Save attachments with the message?
</li>
<li>
readreceipt: (boolean) Add return receipt headers?
</li>
<li>
useragent: (string) The User-Agent string to use.
</li>
</ul>
Returns
boolean Whether the sent message has been saved in the
sent-mail folder.
Throws
|
public
|
#
sendMessage( array $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 Horde_Mime_Part object that
contains the text to send.</p>
Throws
|
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. 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'
header strings.
- list: (array) Recipient addresses (address objects).
- recips: (array) List of recipient addresses (string).
|
public
array
|
#
replyMessage( integer $type, IMP_Contents $contents, string $to = null )
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.
- $to
- <p>The recipient of the reply. Overrides
the automatically determined value.</p>
Returns
array An array with the following keys:
- body: The text of the body part
- format: The format of the body message
- headers: The headers of the message to use for the reply
- identity: The identity to use for the reply based on the original
message's addresses.
- lang: An array of language code (keys)/language name (values) of
the original sender's preferred language(s).
- reply_list_id: List ID label.
- reply_recip: Number of recipients in reply list.
- type: The reply type used (either self::REPLY_ALL,
self::REPLY_LIST, or self::REPLY_SENDER).
|
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 )
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?
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').
-
headers: (array) The headers of the message to use for the reply.
-
identity: (mixed) See Imp_Prefs_Identity#getMatchingIdentity().
-
type: (integer) - The forward type used. Either:
- self::FORWARD_ATTACH
- self::FORWARD_BODY
- self::FORWARD_BOTH
|
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
|
#
redirectMessage( IMP_Indices $indices )
Prepare a redirect message.
Prepare a redirect message.
Parameters
- $indices
- An indices object.
|
public
array
|
#
sendRedirectMessage( string $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
string
|
#
addUploadAttachment( string $name )
Adds an attachment to a Horde_Mime_Part from an uploaded file.
Adds an attachment to a Horde_Mime_Part from an uploaded file.
Parameters
- $name
- The input field name from the form.
Returns
string The filename.
Throws
|
public
|
#
addMimePartAttachment( Horde_Mime_Part $part )
Adds an attachment to a Horde_Mime_Part from data existing in the part.
Adds an attachment to a Horde_Mime_Part from data existing in the part.
Parameters
- $part
- <p>The object that contains the attachment
data.</p>
Throws
|
public
|
|
public
integer
|
#
sizeOfAttachments( )
Returns the size of the attachments in bytes.
Returns the size of the attachments in bytes.
Returns
integer The size of the attachments (in bytes).
|
public
Horde_Mime_Part
|
#
buildAttachment( integer $id )
Build a single attachment part with its data.
Build a single attachment part with its data.
Parameters
- $id
- The ID of the part to rebuild.
Returns
Horde_Mime_Part The Horde_Mime_Part with its contents.
|
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
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 allowed?
What is the maximum attachment size allowed?
Returns
integer The maximum attachment size allowed (in bytes).
|
public
Horde_Mime_Part
|
#
linkAttachments( Horde_Mime_Part $part )
Remove all attachments from an email message and replace with
urls to downloadable links. Should properly save all
attachments to a new folder and remove the Horde_Mime_Parts for the
attachments.
Remove all attachments from an email message and replace with
urls to downloadable links. Should properly save all
attachments to a new folder and remove the Horde_Mime_Parts for the
attachments.
Parameters
- $part
- The body of the message.
Returns
Horde_Mime_Part Modified MIME part with links to attachments.
Throws
|
public
|
#
pgpAttachPubkey( boolean $attach )
Attach the user's PGP public key to every message sent by
buildAndSendMessage().
Attach the user's PGP public key to every message sent by
buildAndSendMessage().
Parameters
- $attach
- True if public key should be attached.
|
public
|
#
attachVCard( mixed $name )
Attach the user's vCard to every message sent by buildAndSendMessage().
Attach the user's vCard to every message sent by buildAndSendMessage().
Parameters
- $name
- <p>The user's name. If false, will not attach
vCard to message.</p>
Throws
|
public
|
#
userLinkAttachments( boolean $attach )
Has user specifically asked attachments to be linked in outgoing
messages?
Has user specifically asked attachments to be linked in outgoing
messages?
Parameters
- $attach
- True if attachments should be linked.
|
public
boolean
|
#
addFilesFromUpload( string $field, boolean $notify = false )
Add uploaded files from form data.
Add uploaded files from form data.
Parameters
- $field
- The field prefix (numbering starts at 1).
- $notify
- <p>Add a notification message for each successful
attachment?</p>
Returns
boolean Returns false if any file was unsuccessfully added.
|
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
|
#
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
string
|
#
formatAddr( string $addr )
Formats the address properly.
Formats the address properly.
Parameters
- $addr
- The address to format.
Returns
string The formatted address.
|
public static
array
|
#
expandAddresses( string $addrString, array $options = array() )
Uses the Registry to expand names and return error information for
any address that is either not valid or fails to expand. This function
will not search if the address string is empty.
Uses the Registry to expand names and return error information for
any address that is either not valid or fails to expand. This function
will not search if the address string is empty.
Parameters
- $addrString
- The name(s) or address(es) to expand.
- $options
- <p>Additional options:
- levenshtein: (boolean) If true, will sort the results using the
PHP levenshtein() scoring function.</p>
Returns
array All matching addresses.
|
public static
mixed
|
#
getAddressList( string $search = '', boolean $email = false, boolean $count = false )
Uses the Registry to obtain a list of e-mail addresses in the
addressbook.
Uses the Registry to obtain a list of e-mail addresses in the
addressbook.
Parameters
- $search
- The term to search by.
- $email
- <p>Return the e-mail only? Otherwise, returns
the full address.</p>
- $count
- Only return the count of results.
Returns
mixed array|integer All matching addresses, or the count of
matching results.
|
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
|
#
current( )
Implementation of
Iterator::current()
|
public
|
#
key( )
Implementation of
Iterator::key()
|
public
|
#
next( )
Implementation of
Iterator::next()
|
public
|
#
rewind( )
Implementation of
Iterator::rewind()
|
public
|
#
valid( )
Implementation of
Iterator::valid()
|
public
|
#
serialize( )
Implementation of
Serializable::serialize()
|
public
|
#
unserialize( mixed $data )
Implementation of
Serializable::unserialize()
|