note 18694 added to function.mail

From: Date: Thu, 31 Jan 2002 18:32:52 +0000
Subject: note 18694 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-26101@lists.php.net to get a copy of this message
I'm having problems with attaching a word doc that outlook will read and not prompt me to install something. Has anyone esle had this problem? I think it's a content-type issue. my code: if ($file_01) { $fp = fopen($file_01, "rb"); $data = fread($fp, filesize($file_01)); $data = chunk_split(base64_encode($data)); fclose($fp); $date = "$file_01"; // add the MIME data $str .= "--" . $boundary . "\r\n"; $str .= "Content-Type: application/octet-stream; name=\"" . $file_01 ."\"\r\n"; $str .= "Content-Transfer-Encoding: base64\r\n"; $str .= "Content-Disposition: attachment; filename=\"" . $file_01 ."\"\r\n\r\n"; $str .= $data . "\r\n"; } Thanks, -p -- http://www.php.net/manual/en/function.mail.php http://master.php.net/manage/user-notes.php?action=edit+18694 http://master.php.net/manage/user-notes.php?action=delete+18694 http://master.php.net/manage/user-notes.php?action=reject+18694

« previous php.notes (#26101) next »