note 49811 deleted from function.mail by nlopess
| From: | nlopess@php.net | Date: | Wed, 09 Feb 2005 16:11:07 +0000 |
| Subject: | note 49811 deleted from function.mail by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-84731@lists.php.net to get a copy of this message | ||
Note Submitter: MAX_DB_C (AT) HTOMAIL.COM
----
Hi
Im using a script to send a file to the site admin.
It works locally ON WINDOWS (php 4.3.4) but does not on the remote
server UNIX (php 4.3.10).
In fact on the remote it does send the mail with the data
from the input fields but there is no file attached instead its got this :
--==Multipart_Boundary_x206067939527cd5646ed2a4c53bdf6c3x
Content-Type: application/msword;
name="alo.doc"
Content-Disposition: attachment;
filename="alo.doc"
Content-Transfer-Encoding: base64
0M8R4KGxGuEAAAAAAAAAAAAAAAAA
AAAAPgADAP7/CQAGAAAAAAAAAAAAA
AABAAAAJwAAAAAAAAAA
EAAAKQAAAAEAAAD+////AAAAACYAAAD
/////////////////////////////////////////
EAAAKQAAAAEAAAD+////
/////////////////////////////////////////
///////////////////////////////////
/////////////////////////////////////////
///////////////////////////////////
/////////////////////////////////////////
////////////////
anyone know what may be wrong? is the problem the difference in php versions?
Tnx
for reference here is the code relative to sending the file
------------------------
------------------------
// Obtain file upload vars
$fileatt = $_FILES['attachresume']['tmp_name'];
$fileatt_type = $_FILES['attachresume']['type'];
$fileatt_name = $_FILES['attachresume']['name'];
$message="";
$data="";
if (is_uploaded_file($fileatt)) {
// Read the file to be attached ('rb' = read binary)
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
}
// Base64 encode the file data
$data = chunk_split(base64_encode($data));
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$msg .= _JL_RECEIVED_APPLICATION;
// Add a multipart boundary above the plain message
$message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n".
$msg . "\n\n";
// Add file attachment to the message
$message .= "--{$mime_boundary}\n" . " Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
"Content-Disposition: attachment;\n" .
" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n".
"--{$mime_boundary}--\n";