/functions/compose.php

Description

compose.php

Functions for message compositon: writing a message, attaching files etc.

Functions
sq_get_attach_tempfile (line 24)

Get a new file to write an attachment to.

This function makes sure it doesn't overwrite other attachments, preventing collisions and race conditions.

  • return: of the tempfile only (not full path)
  • since: 1.5.2
filename sq_get_attach_tempfile ()
sq_send_mail (line 104)

Send a simple mail message using SquirrelMail's API.

Until SquirrelMail is sufficiently redesigned, this function is a stand-in for a simple mail delivery call. Currently, it only sends plaintext messages (unless the caller uses the $message parameter).

  • return: A three-element array, the first element being a boolean value indicating if the message was successfully sent or not, the second element being the message's assigned Message-ID, if available (only available as of SquirrelMail 1.4.14 and 1.5.2), and the third element being the message object itself. If $only_build_message_object is TRUE, only the third element is useful; first two should be ignored - the message is never sent in this case.
array sq_send_mail (string $to, string $subject, string $body, string $from, [string $cc = ''], [string $bcc = ''], [object $message = ''], [boolean $only_build_message_object = FALSE])
  • string $to: The destination recipient.
  • string $subject: The message subject.
  • string $body: The message body.
  • string $from: The sender.
  • string $cc: The destination carbon-copy recipient. (OPTIONAL; default no Cc:)
  • string $bcc: The destination blind carbon-copy recipient. (OPTIONAL; default no Bcc:)
  • object $message: If the caller wants to construct a more complicated message themselves and pass it here, this function will take care of the rest - handing it over to SMTP or Sendmail. If this parameter is non- empty, all other parameters are ignored. (OPTIONAL: default is empty)
  • boolean $only_build_message_object: When TRUE, only builds the message object that it intends to send and returns it (returned success code will be -1 and message ID emtpy) (OPTIONAL; default is FALSE)

Documentation generated on Mon, 13 Jan 2020 04:22:09 +0100 by phpDocumentor 1.4.3