Пример #1
0
/**
 *
 * @global <type> $conf
 * @param <type> $story_part
 * @param <type> $from
 * @param <type> $recipients
 * @param <type> $subject
 * @param <type> $note
 * @return <type>
 */
function _mail($story_part, $from, $recipients, $subject, $note)
{
    throw new Jonah_Exception('Needs refactoring.');
    global $conf;
    /* Create the MIME message. */
    $mail = new Horde_Mime_Mail(array('Subject' => $subject, 'To' => $recipients, 'From' => $from, 'User-Agent' => 'Jonah ' . $GLOBALS['registry']->getVersion()));
    /* If a note has been provided, add it to the message as a text part. */
    if (strlen($note) > 0) {
        $message_note = new MIME_Part('text/plain', null, 'UTF-8');
        $message_note->setContents($message_note->replaceEOL($note));
        $message_note->setDescription(_("Note"));
        $mail->addMIMEPart($message_note);
    }
    /* Get the story as a MIME part and add it to our message. */
    $mail->addMIMEPart($story_part);
    /* Log the pending outbound message. */
    Horde::log(sprintf('<%s> is sending "%s" to (%s)', $from, $subject, $recipients), 'INFO');
    /* Send the message and return the result. */
    return $mail->send(Horde::getMailerConfig());
}