
20/07/2007, 20:33
|
 | | | Fecha de Ingreso: agosto-2006 Ubicación: Rosario
Mensajes: 655
Antigüedad: 18 años, 7 meses Puntos: 22 | |
Re: Formulario con archivo adjunto Mira este codigo: Código PHP: <? PHP
$attach = chunk_split(base64_encode(file_get_contents($_FILE["file"]["tmp_name"])));
$attach_name = $_FILE["file"]["name"];
$attach_type = $_FILE["file"]["type"];
$subject = "hola ^^";
$mail = "[email protected]";
$msg = "email";
$header = "From: mi<[email protected]>\nReply-To: $mail\nMIME-version: 1.0\nContent-type: multipart/mixed; boundary=\"Message-Boundary\"\nContent-transfer-encoding: 7BIT\nX-attachments: $attach_name";
$body = "--Message-Boundary\nContent-type: text/plain; charset=US-ASCII\nContent-transfer-encoding: 7BITContent-description: Mail message body\n\n";
$body .= $msg;
$body .= "\n\n--Message-Boundary\nContent-type: Binary; name=\"$attach_name\"\nContent-Transfer-Encoding: BASE64\nContent-disposition: attachment; filename=\"$attach_name\"\n\n$attach\n--Message-Boundary--\n";
mail($mail, $subject, $body, $header);
?> Espero que te sirva ^^
Exitos. |