All,

I'm building a tool that takes form input and sends out an html email with a
word doc attached.
It sends the text and html version of the email but I can't open the
attachment. It opens blank.

Anyone have a thought or two about this?

<php snippet>
        if ($attachment) {
        $fp = fopen($attachment, "rb");
        $data = fread($fp, filesize($attachment));
        $data = chunk_split(base64_encode($data));
        fclose($fp);

        // add the MIME data
        $str .= "--" . $boundary . "\r\n";
        $str .= "Content-Type: application/octet-stream; name=\"" .
$attachment ."\"\r\n";
        $str .= "Content-Transfer-Encoding: base64\r\n";
        $str .= "Content-Disposition: attachment; filename=\"" . $attachment
."\"\r\n\r\n";
        $str .= $data . "\r\n";
        }
</php snippet>

thanks,
-p


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to