roundcubemail/program/lib/Roundcube/rcube_imap_generic.php
public function appendFromFile($mailbox, $path, $headers=null, $flags = array(), $date = null, $binary = false)
    {
        // open message file
        if (file_exists(realpath($path))) {
            $fp = fopen($path, 'r');
        }

        if (!$fp) {
            $this->setError(self::ERROR_UNKNOWN, "Couldn't open $path for reading");
            return false;
        }

        $message = array();
        if ($headers) {
            $message[] = trim($headers, "\r\n") . "\r\n\r\n";
        }
        $message[] = $fp;

        return $this->append($mailbox, $message, $flags, $date, $binary);
    }
public function appendFromFile($mailbox, $path, $headers=null, $flags = array(), $date = null, $binary = false)
    {
        // open message file
        if (file_exists(realpath($path))) {
            $fp = fopen($path, 'r');
        }

        if (!$fp) {
            $this->setError(self::ERROR_UNKNOWN, "Couldn't open $path for reading");
            return false;
        }

        $message = array();
        if ($headers) {
            $message[] = trim($headers, "\r\n") . "\r\n\r\n";
        }
        $message[] = $fp;

        return $this->append($mailbox, $message, $flags, $date, $binary);
    }
public function appendFromFile ( $ mailbox , $ path , $ headers = null , $ flags = array ( ) , $ date = null , $ binary = false ) { // open message file if ( file_exists ( realpath ( $ path ) ) ) { $ fp = fopen ( $ path , 'r' ) ; } if ( ! $ fp ) { $ this -> setError ( self :: ERROR_UNKNOWN , "Couldn't open $path for reading" ) ; return false ; } $ message = array ( ) ; if ( $ headers ) { $ message [ ] = trim ( $ headers , "\r\n" ) . "\r\n\r\n" ; } $ message [ ] = $ fp ; return $ this -> append ( $ mailbox , $ message , $ flags , $ date , $ binary ) ; }
Handler for IMAP APPEND command.

@param string $mailbox Mailbox name
@param string $path    Path to the file with message body
@param string $headers Message headers
@param array  $flags   Message flags
@param string $date    Message internal date
@param bool   $binary  Enable BINARY append (RFC3516)

@return string|bool On success APPENDUID response (if available) or True, False on failure
Handler for IMAP APPEND command .