PHP Class IMP_Compose, horde

Author: Michael Slusarz ([email protected])
Inheritance: implements ArrayAccess, implements Countable, implements IteratorAggregate
ファイルを表示 Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$atcId integer Attachment ID counter.
$changed string Either empty, 'changed', or 'deleted'.
$charset string The charset to use for sending.

Protected Properties

Property Type Description
$_atc array Attachment data.
$_cacheid string The cache ID used to store object in session.
$_metadata array Various metadata for this message.
$_replytype integer The reply type.

Public Methods

Method Description
__construct ( string $cacheid ) Constructor.
__toString ( ) String representation: the cache ID.
__wakeup ( ) Tasks to do upon unserialize().
_getMessageTextCallback ( $id, $attribute, $node ) : string Callback used in _getMessageText().
_saveRecipients ( Horde_Mail_Rfc822_List $recipients ) Save the recipients done in a sendMessage().
addAttachmentFromPart ( Horde_Mime_Part $part ) : IMP_Compose_Attachment Adds an attachment from Horde_Mime_Part data.
addAttachmentFromUpload ( string $field ) : array Add attachment from uploaded (form) data.
addRelatedAttachment ( IMP_Compose_Attachment $atc_ob, DOMElement $node, string $attribute ) Add an attachment referred to in a related part.
additionalAttachmentsAllowed ( ) : mixed How many more attachments are allowed?
attachImapMessage ( IMP_Indices $indices ) : string Add mail message(s) from the mail server as a message/rfc822 attachment.
buildAndSendMessage ( string $body, array $header, IMP_Prefs_Identity $identity, array $opts = [] ) Builds and sends a MIME message.
canCompose ( ) : boolean Is composing messages allowed?
canHtmlCompose ( ) : boolean Is the HTML editor available for compostion?
canUploadAttachment ( ) : boolean Can attachments be uploaded?
count ( ) : integer Returns the number of attachments currently in this message.
deleteAllAttachments ( ) Deletes all attachments.
destroy ( string $action ) Destroys an IMP_Compose instance.
editAsNew ( IMP_Indices $indices, array $opts = [] ) : mixed Edits a message as new.
editTemplate ( IMP_Indices $indices ) : mixed Edit an existing template message. Saving this template later (using saveTemplate()) will cause the original message to be deleted.
forwardMessage ( integer $type, IMP_Contents $contents, boolean $attach = true, array $opts = [] ) : array Determine the text and headers for a forwarded message.
forwardMessageText ( IMP_Contents $contents, array $opts = [] ) : array Returns the forward text for a message.
forwardMultipleMessages ( IMP_Indices $indices ) : array Prepares a forwarded message using multiple messages.
getCacheId ( ) : string Obtains the cache ID for the session object.
getContentsOb ( ) : mixed If this object contains sufficient metadata, return an IMP_Contents object reflecting that metadata.
getHmac ( string $cacheid = null, string $user = null ) : string 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.
getIterator ( )
getMetadata ( string $name ) : mixed Gets metadata about the current object.
hasDrafts ( ) : boolean Does this message have any drafts associated with it?
maxAttachmentSize ( ) : integer What is the maximum attachment size?
offsetExists ( $offset ) * ArrayAccess methods.
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
recipientList ( array $hdr ) : array Cleans up and returns the recipient list. Method designed to parse user entered data; does not encode/validate addresses.
recoverSessionExpireDraft ( ) Restore session expiration draft compose data.
redirectMessage ( IMP_Indices $indices ) Prepare a redirect message.
replyMessage ( integer $type, IMP_Contents $contents, array $opts = [] ) : array Determines the reply text and headers for a message.
replyMessageText ( IMP_Contents $contents, array $opts = [] ) : array Returns the reply text for a message.
replyType ( boolean $base = false ) : string Return the reply type.
resumeDraft ( IMP_Indices $indices, array $opts = [] ) : mixed Resumes a previously saved draft message.
saveDraft ( array $headers, mixed $message, array $opts = [] ) : string Saves a draft message.
saveTemplate ( array $headers, mixed $message, array $opts = [] ) : string Save a template message on the IMAP server.
sendMessage ( Horde_Mail_Rfc822_List $email, Horde_Mime_Headers $headers, Horde_Mime_Part $message ) Sends a message.
sendRedirectMessage ( mixed $to, boolean $log = true ) : array Send a redirect (a/k/a resent) message. See RFC 5322 [3.6.6].
sessionExpireDraft ( Horde_Variables $vars ) Store draft compose data if session expires.
text2html ( string $msg ) : string Shortcut function to convert text -> HTML for purposes of composition.
useTemplate ( IMP_Indices $indices, array $opts = [] ) : mixed Uses a template to create a message.

Protected Methods

Method Description
_addAttachment ( string $atc_file, integer $bytes, string $filename, string $type ) : IMP_Compose_Attachment Adds an attachment to the outgoing compose message.
_cleanHtmlOutput ( Horde_Domhtml $html ) Clean outgoing HTML (remove unexpected data URLs).
_convertToRelated ( Horde_Domhtml $html, Horde_Mime_Part $part ) : Horde_Mime_Part Converts an HTML part to a multipart/related part, if necessary.
_createMimeMessage ( string $body, array $options = [] ) : Horde_Mime_Part Create the base Horde_Mime_Part for sending.
_encryptMessage ( Horde_Mime_Part $msg, integer $encrypt, Horde_Mail_Rfc822_List $recip, Horde_Mail_Rfc822_Address $from ) : Horde_Mime_Part Encrypt an outgoing message.
_getMatchingIdentity ( Horde_Mime_Headers $h, array $only = [] ) : integer Get "tieto" identity information.
_getMessageText ( IMP_Contents $contents, array $options = [] ) : mixed Regenerates body text for use in the compose screen from IMAP data.
_getMsgHeaders ( Horde_Mime_Headers $h ) : string Determine the header information to display in the forward/reply.
_linkAttachments ( &$body, mixed $html ) Adds linked attachments to message.
_logSentmail ( Horde_Mime_Headers $headers, Horde_Mail_Rfc822_List $recip, boolean $success ) : string Log a sent action to the sentmail backend.
_msgTextFormat ( array $opts, string $pref_name ) : array Determine text editor format.
_prepSendMessage ( Horde_Mail_Rfc822_List $email, Horde_Mime_Part $message = null ) : string Sanity checking/MIME formatting before sending a message.
_prepSendMessageAssert ( Horde_Mail_Rfc822_List $email ) Recipiet checks to do if this is a user-generated compose message.
_prepSendMessageEncode ( Horde_Mail_Rfc822_List $email, string $charset ) : string Encode address and do sanity checking on encoded address.
_prepareHeaders ( array $headers, array $opts = [] ) : Horde_Mime_Headers Prepare header object with basic header fields and converts headers to the current compose charset.
_resumeDraft ( IMP_Indices $indices, integer $type, array $opts ) : mixed Resumes a previously saved draft message.
_saveDraftMsg ( array $headers, mixed $message, array $opts ) : string Prepare the draft message.
_saveDraftServer ( string $data ) : string Save a draft message on the IMAP server.
_saveToSentMail ( Horde_Mime_Headers $headers, Horde_Mime_Part $save_msg, Horde_Mail_Rfc822_List $recips, array $opts ) Save message to sent-mail mailbox, if configured to do so.
_setMetadata ( string $name, mixed $value ) Sets metadata for the current object.

Method Details

__construct() public method

Constructor.
public __construct ( string $cacheid )
$cacheid string The cache ID string.

__toString() public method

String representation: the cache ID.
public __toString ( )

__wakeup() public method

Tasks to do upon unserialize().
public __wakeup ( )

_addAttachment() protected method

Adds an attachment to the outgoing compose message.
protected _addAttachment ( string $atc_file, integer $bytes, string $filename, string $type ) : IMP_Compose_Attachment
$atc_file string Temporary file containing attachment contents.
$bytes integer Size of data, in bytes.
$filename string Filename of data.
$type string MIME type of data.
return IMP_Compose_Attachment Attachment object.

_cleanHtmlOutput() protected method

Clean outgoing HTML (remove unexpected data URLs).
protected _cleanHtmlOutput ( Horde_Domhtml $html )
$html Horde_Domhtml The HTML data.

_convertToRelated() protected method

Converts an HTML part to a multipart/related part, if necessary.
protected _convertToRelated ( Horde_Domhtml $html, Horde_Mime_Part $part ) : Horde_Mime_Part
$html Horde_Domhtml HTML data.
$part Horde_Mime_Part The HTML part.
return Horde_Mime_Part The part to add to the compose output.

_createMimeMessage() protected method

Create the base Horde_Mime_Part for sending.
protected _createMimeMessage ( string $body, array $options = [] ) : Horde_Mime_Part
$body string Message body.
$options array Additional options: - html: (boolean) Is this a HTML message? - identity: (IMP_Prefs_Identity) Identity of the sender. - nofinal: (boolean) This is not a message which will be sent out. - noattach: (boolean) Don't add attachment information. - pgp_attach_pubkey: (boolean) Attach the user's PGP public key? - recip: (Horde_Mail_Rfc822_List) The recipient list. - signature: (IMP_Prefs_Identity|string) If set, add the signature to the message. - vcard_attach: (string) If set, attach user's vcard to message.
return Horde_Mime_Part The base MIME part.

_encryptMessage() protected method

Encrypt an outgoing message.
protected _encryptMessage ( Horde_Mime_Part $msg, integer $encrypt, Horde_Mail_Rfc822_List $recip, Horde_Mail_Rfc822_Address $from ) : Horde_Mime_Part
$msg Horde_Mime_Part Outgoing message.
$encrypt integer Encryption type.
$recip Horde_Mail_Rfc822_List Recipient list.
$from Horde_Mail_Rfc822_Address Sending address.
return Horde_Mime_Part $msg Processed outgoing message.

_getMatchingIdentity() protected method

Get "tieto" identity information.
protected _getMatchingIdentity ( Horde_Mime_Headers $h, array $only = [] ) : integer
$h Horde_Mime_Headers The headers object for the message.
$only array Only use these headers.
return integer The matching identity. If no exact match, returns the default identity.

_getMessageText() protected method

Regenerates body text for use in the compose screen from IMAP data.
protected _getMessageText ( IMP_Contents $contents, array $options = [] ) : mixed
$contents IMP_Contents An IMP_Contents object.
$options array Additional options:
  • html: (boolean) Return text/html part, if available.
  • imp_msg: (integer) If non-empty, the message data was created by IMP. Either:
    • self::COMPOSE
    • self::FORWARD
    • self::REPLY
  • replylimit: (boolean) Enforce length limits?
  • toflowed: (boolean) Do flowed conversion?
return mixed Null if bodypart not found, or array with the following keys: - charset: (string) The guessed charset to use. - flowed: (Horde_Text_Flowed) A flowed object, if the text is flowed. Otherwise, null. - id: (string) The MIME ID of the bodypart. - mode: (string) Either 'text' or 'html'. - text: (string) The body text.

_getMessageTextCallback() public method

Callback used in _getMessageText().
public _getMessageTextCallback ( $id, $attribute, $node ) : string
return string Replacement text.

_getMsgHeaders() protected method

Determine the header information to display in the forward/reply.
protected _getMsgHeaders ( Horde_Mime_Headers $h ) : string
$h Horde_Mime_Headers The headers object for the message.
return string The header information for the original message.

_linkAttachments() protected method

Adds linked attachments to message.
protected _linkAttachments ( &$body, mixed $html )
$html mixed HTML data (Horde_Domhtml) or null.

_logSentmail() protected method

Log a sent action to the sentmail backend.
protected _logSentmail ( Horde_Mime_Headers $headers, Horde_Mail_Rfc822_List $recip, boolean $success ) : string
$headers Horde_Mime_Headers Message headers.
$recip Horde_Mail_Rfc822_List Message recipients.
$success boolean Send success.
return string Message-ID value.

_msgTextFormat() protected method

Determine text editor format.
protected _msgTextFormat ( array $opts, string $pref_name ) : array
$opts array Options (contains 'format' param).
$pref_name string The pref name that controls formatting.
return array Use HTML? and Force HTML?

_prepSendMessage() protected method

Sanity checking/MIME formatting before sending a message.
protected _prepSendMessage ( Horde_Mail_Rfc822_List $email, Horde_Mime_Part $message = null ) : string
$email Horde_Mail_Rfc822_List The e-mail list to send to.
$message Horde_Mime_Part The object that contains the text to send.
return string The encoded $email list.

_prepSendMessageAssert() protected method

Recipiet checks to do if this is a user-generated compose message.
protected _prepSendMessageAssert ( Horde_Mail_Rfc822_List $email )
$email Horde_Mail_Rfc822_List The e-mail list to send to.

_prepSendMessageEncode() protected method

Encode address and do sanity checking on encoded address.
protected _prepSendMessageEncode ( Horde_Mail_Rfc822_List $email, string $charset ) : string
$email Horde_Mail_Rfc822_List The e-mail list to send to.
$charset string The charset to encode to.
return string The encoded $email list.

_prepareHeaders() protected method

Prepare header object with basic header fields and converts headers to the current compose charset.
protected _prepareHeaders ( array $headers, array $opts = [] ) : Horde_Mime_Headers
$headers array Array with 'from', 'to', 'cc', 'bcc', and 'subject' values.
$opts array An array of options w/the following keys: - priority: (string) The message priority ('high', 'normal', 'low').
return Horde_Mime_Headers Headers object with the appropriate headers set.

_resumeDraft() protected method

Resumes a previously saved draft message.
protected _resumeDraft ( IMP_Indices $indices, integer $type, array $opts ) : mixed
$indices IMP_Indices See resumeDraft().
$type integer Compose type.
$opts array Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine.
return mixed See resumeDraft().

_saveDraftMsg() protected method

Prepare the draft message.
protected _saveDraftMsg ( array $headers, mixed $message, array $opts ) : string
$headers array List of message headers.
$message mixed Either the message text (string) or a Horde_Mime_Part object that contains the text to send.
$opts array 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? - verify_email: (boolean) Verify e-mail messages? Default: no.
return string The body text.

_saveDraftServer() protected method

Save a draft message on the IMAP server.
protected _saveDraftServer ( string $data ) : string
$data string The text of the draft message.
return string Status string (not HTML escaped).

_saveRecipients() public method

Save the recipients done in a sendMessage().
public _saveRecipients ( Horde_Mail_Rfc822_List $recipients )
$recipients Horde_Mail_Rfc822_List The list of recipients.

_saveToSentMail() protected method

Save message to sent-mail mailbox, if configured to do so.
protected _saveToSentMail ( Horde_Mime_Headers $headers, Horde_Mime_Part $save_msg, Horde_Mail_Rfc822_List $recips, array $opts )
$headers Horde_Mime_Headers Headers object.
$save_msg Horde_Mime_Part Message data to save.
$recips Horde_Mail_Rfc822_List Recipient list.
$opts array See buildAndSendMessage()

_setMetadata() protected method

Sets metadata for the current object.
protected _setMetadata ( string $name, mixed $value )
$name string The metadata name.
$value mixed The metadata value.

addAttachmentFromPart() public method

Adds an attachment from Horde_Mime_Part data.
public addAttachmentFromPart ( Horde_Mime_Part $part ) : IMP_Compose_Attachment
$part Horde_Mime_Part The object that contains the attachment data.
return IMP_Compose_Attachment Attachment object.

addAttachmentFromUpload() public method

Add attachment from uploaded (form) data.
public addAttachmentFromUpload ( string $field ) : array
$field string The form field name.
return array A list of IMP_Compose_Attachment objects (if successfully attached) or IMP_Compose_Exception objects (if error when attaching).

addRelatedAttachment() public method

Add an attachment referred to in a related part.
public addRelatedAttachment ( IMP_Compose_Attachment $atc_ob, DOMElement $node, string $attribute )
$atc_ob IMP_Compose_Attachment
$node DOMElement Node element containg the related reference.
$attribute string Element attribute containing the related reference.

additionalAttachmentsAllowed() public method

How many more attachments are allowed?
public additionalAttachmentsAllowed ( ) : mixed
return mixed Returns true if no attachment limit. Else returns the number of additional attachments allowed.

attachImapMessage() public method

Add mail message(s) from the mail server as a message/rfc822 attachment.
public attachImapMessage ( IMP_Indices $indices ) : string
$indices IMP_Indices An indices object.
return string Subject string.

buildAndSendMessage() public method

Builds and sends a MIME message.
public buildAndSendMessage ( string $body, array $header, IMP_Prefs_Identity $identity, array $opts = [] )
$body string The message body.
$header array List of message headers.
$identity IMP_Prefs_Identity The Identity object for the sender of this message.
$opts array An array of options w/the following keys: - encrypt: (integer) A flag whether to encrypt or sign the message. One of: - IMP_Pgp::ENCRYPT - IMP_Pgp::SIGNENC - IMP_Smime::ENCRYPT - IMP_Smime::SIGNENC - 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).

canCompose() public static method

Is composing messages allowed?
public static canCompose ( ) : boolean
return boolean True if compose allowed.

canHtmlCompose() public static method

Is the HTML editor available for compostion?
public static canHtmlCompose ( ) : boolean
return boolean True if HTML editor is available.

canUploadAttachment() public static method

Can attachments be uploaded?
public static canUploadAttachment ( ) : boolean
return boolean True if attachments can be uploaded.

count() public method

Returns the number of attachments currently in this message.
public count ( ) : integer
return integer The number of attachments in this message.

deleteAllAttachments() public method

Deletes all attachments.

destroy() public method

Destroys an IMP_Compose instance.
public destroy ( string $action )
$action string The action performed to cause the end of this instance. Either 'cancel', 'discard', 'save_draft', or 'send'.

editAsNew() public method

Edits a message as new.
public editAsNew ( IMP_Indices $indices, array $opts = [] ) : mixed
$indices IMP_Indices An indices object.
$opts array Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine.
return mixed See resumeDraft().

editTemplate() public method

Edit an existing template message. Saving this template later (using saveTemplate()) will cause the original message to be deleted.
public editTemplate ( IMP_Indices $indices ) : mixed
$indices IMP_Indices An indices object.
return mixed See resumeDraft().

forwardMessage() public method

Determine the text and headers for a forwarded message.
public forwardMessage ( integer $type, IMP_Contents $contents, boolean $attach = true, array $opts = [] ) : array
$type integer The forward type (self::FORWARD* constant).
$contents IMP_Contents An IMP_Contents object.
$attach boolean Attach the forwarded message?
$opts array Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine.
return 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.

forwardMessageText() public method

Returns the forward text for a message.
public forwardMessageText ( IMP_Contents $contents, array $opts = [] ) : array
$contents IMP_Contents An IMP_Contents object.
$opts array Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine.
return 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').

forwardMultipleMessages() public method

Prepares a forwarded message using multiple messages.
public forwardMultipleMessages ( IMP_Indices $indices ) : array
$indices IMP_Indices An indices object containing the indices of the forwarded messages.
return 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.

getCacheId() public method

Obtains the cache ID for the session object.
public getCacheId ( ) : string
return string The message cache ID.

getContentsOb() public method

If this object contains sufficient metadata, return an IMP_Contents object reflecting that metadata.
public getContentsOb ( ) : mixed
return mixed Either an IMP_Contents object or null.

getHmac() public method

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.
public getHmac ( string $cacheid = null, string $user = null ) : string
$cacheid string The cache ID to use. If null, uses cache ID of the compose object.
$user string The user ID to use. If null, uses the current authenticated username.
return string The HMAC hash string.

getIterator() public method

public getIterator ( )

getMetadata() public method

Gets metadata about the current object.
public getMetadata ( string $name ) : mixed
$name string The metadata name.
return mixed The metadata value or null if it doesn't exist.

hasDrafts() public method

Does this message have any drafts associated with it?
public hasDrafts ( ) : boolean
return boolean True if draft messages exist.

maxAttachmentSize() public static method

What is the maximum attachment size?
public static maxAttachmentSize ( ) : integer
return integer The maximum attachment size (in bytes).

offsetExists() public method

* ArrayAccess methods.
public offsetExists ( $offset )

offsetGet() public method

public offsetGet ( $offset )

offsetSet() public method

public offsetSet ( $offset, $value )

offsetUnset() public method

public offsetUnset ( $offset )

recipientList() public method

Cleans up and returns the recipient list. Method designed to parse user entered data; does not encode/validate addresses.
public recipientList ( array $hdr ) : array
$hdr array An array of MIME headers and/or address list objects. Recipients will be extracted from the 'to', 'cc', and 'bcc' entries.
return 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.

recoverSessionExpireDraft() public method

Restore session expiration draft compose data.

redirectMessage() public method

Prepare a redirect message.
public redirectMessage ( IMP_Indices $indices )
$indices IMP_Indices An indices object.

replyMessage() public method

Determines the reply text and headers for a message.
public replyMessage ( integer $type, IMP_Contents $contents, array $opts = [] ) : array
$type integer The reply type (self::REPLY* constant).
$contents IMP_Contents An IMP_Contents object.
$opts array Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine. - to: (string) The recipient of the reply. Overrides the automatically determined value.
return 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).

replyMessageText() public method

Returns the reply text for a message.
public replyMessageText ( IMP_Contents $contents, array $opts = [] ) : array
$contents IMP_Contents An IMP_Contents object.
$opts array Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine.
return 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').

replyType() public method

Return the reply type.
public replyType ( boolean $base = false ) : string
$base boolean Return the base reply type?
return string The reply type, or null if not a reply.

resumeDraft() public method

Resumes a previously saved draft message.
public resumeDraft ( IMP_Indices $indices, array $opts = [] ) : mixed
$indices IMP_Indices An indices object.
$opts array Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine.
return 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.

saveDraft() public method

Saves a draft message.
public saveDraft ( array $headers, mixed $message, array $opts = [] ) : string
$headers array List of message headers (UTF-8).
$message mixed Either the message text (string) or a Horde_Mime_Part object that contains the text to send.
$opts array 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?
return string Notification text on success (not HTML encoded).

saveTemplate() public method

Save a template message on the IMAP server.
public saveTemplate ( array $headers, mixed $message, array $opts = [] ) : string
$headers array List of message headers (UTF-8).
$message mixed Either the message text (string) or a Horde_Mime_Part object that contains the text to save.
$opts array 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?
return string Notification text on success.

sendMessage() public method

Sends a message.
public sendMessage ( Horde_Mail_Rfc822_List $email, Horde_Mime_Headers $headers, Horde_Mime_Part $message )
$email Horde_Mail_Rfc822_List The e-mail list to send to.
$headers Horde_Mime_Headers The object holding this message's headers.
$message Horde_Mime_Part The object that contains the text to send.

sendRedirectMessage() public method

Send a redirect (a/k/a resent) message. See RFC 5322 [3.6.6].
public sendRedirectMessage ( mixed $to, boolean $log = true ) : array
$to mixed The addresses to redirect to.
$log boolean Whether to log the resending in the history and sentmail log.
return 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.

sessionExpireDraft() public method

Store draft compose data if session expires.
public sessionExpireDraft ( Horde_Variables $vars )
$vars Horde_Variables Object with the form data.

text2html() public static method

Shortcut function to convert text -> HTML for purposes of composition.
public static text2html ( string $msg ) : string
$msg string The message text.
return string HTML text.

useTemplate() public method

Uses a template to create a message.
public useTemplate ( IMP_Indices $indices, array $opts = [] ) : mixed
$indices IMP_Indices An indices object.
$opts array Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine.
return mixed See resumeDraft().

Property Details

$_atc protected_oe property

Attachment data.
protected array $_atc
return array

$_cacheid protected_oe property

The cache ID used to store object in session.
protected string $_cacheid
return string

$_metadata protected_oe property

Various metadata for this message.
protected array $_metadata
return array

$_replytype protected_oe property

The reply type.
protected int $_replytype
return integer

$atcId public_oe property

Attachment ID counter.
public int $atcId
return integer

$changed public_oe property

Either empty, 'changed', or 'deleted'.
public string $changed
return string

$charset public_oe property

The charset to use for sending.
public string $charset
return string