This nifty code (taken from PHP Cookbook) sends an email with a file
"attached" in-line.  The text from the attached file appears within the
body of the email.  I need to send attached files that are not in-line,
but, rather, come as attached files that the user views outside of their
email browser.  Can somebody help me with this.  Maybe tweak the code
I've got?


                        $to = $the_email;
                        $subject = 'dump';
                        $message = 'this is the dump';
                        $email = '[EMAIL PROTECTED]';
                        $boundary ="b" . md5(uniqid(time()));
                        $mime = "Content-type: multipart/mixed; ";
                        $mime .= "boundary = $boundary\r\n\r\n";
                        $mime .= "This is a MIME encoded
                        //first reg message
                        $mime_message .="--$boundary\r\n";
                        $mime .="Content-type: text/plain\r\n";
                        $mime .="Content-Transfer-Encoding: base64";
                        $mime .="\r\n\r\n" .
chunk_split(base64_encode($message)) . "\r\n";
                        //now attach
                        $filename = "mysqldump/surveydump.txt";
                        $attach = chunk_split(base64_encode(implode("",
                        $mime .="--$boundary\r\n";
                        $mime .="Content-type: text/plain\r\n";
                        $mime .="Content-Transfer-Encoding: base64";
                        $mime .="\r\n\r\n$attach\r\n";

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to