Vale, tengo el código que está compuesto de 2 archivos, los he configurado pero no me van. Son los siguientes:
Este es el codigo del formulario: f_attach.php
<title>COLABORACIÓN</title>
<form enctype="multipart/form-data" name=doit action="env_attach.php" method=POST>
<table cellpadding=0 cellspacing=0 width="295"><tr>
<td width="295" height="26"> <font face="Arial, Helvetica, sans-serif" size="2"><b>Tu
nombre:<br>
</b></font>
<input type="text" name="name" size=30><br>
</td>
</tr>
<tr>
<td width="295"> <font face="Arial, Helvetica, sans-serif" size="2"><b>Tu
e-mail:<br>
</b></font>
<input type="text" name="from" size=30><br>
</td>
</tr>
<tr>
<td width="295"> <font face="Arial, Helvetica, sans-serif" size="2"><b>Archivo:<br>
</b></font>
<input type=file name="attach" size=30><br>
</td>
</tr>
<td width="295">
<tr>
<td width="295" height="23"><font face="Arial, Helvetica, sans-serif" size="2"><b>Asunto:<br>
</b></font>
<input type="text" name="subject" size=30> <br>
</td>
</tr></table>
<p align="left">
<font face="Arial, Helvetica, sans-serif" size="2"><b>Mensaje:</b></font><br>
<textarea name="body" rows=10 cols=35 wrap="message"></textarea><br><br>
<input type="submit" name="sendmail" value="enviar"> </p>
</form>
Este es el del envio: env_attach.php
<?
$mailheaders = "Return-Path: $fromn";
$mailheaders .= "From: $fromn";
$mailheaders .= "name: $namen";
//$mailheaders = "From: $fromn";
$mailheaders .= "X-Mailer: Expresateweb Email Interfacen";
$msg_body = stripslashes($body);
if ($attach != "none"
{
$file = fopen($attach, "r"
$contents = fread($file, $attach_size);
$encoded_attach = chunk_split(base64_encode($contents));
fclose($file);
$mailheaders .= "MIME-version: 1.0n";
$mailheaders .= "Content-type: multipart/mixed; ";
$mailheaders .= "boundary=\"Message-Boundary\"n";
$mailheaders .= "Content-transfer-encoding: 7BITn";
$mailheaders .= "X-attachments: $attach_name";
$body_top = "--Message-Boundaryn";
$body_top .= "Content-type: text/plain; charset=US-ASCIIn";
$body_top .= "Content-transfer-encoding: 7BITn";
$body_top .= "Content-description: Mail message bodynn";
$msg_body = $body_top . $msg_body;
$msg_body .= "nn--Message-Boundaryn";
$msg_body .= "Content-type: $attach_type; name=\"$attach_name\"n";
$msg_body .= "Content-Transfer-Encoding: BASE64n";
$msg_body .= "Content-disposition: attachment; filename=\"$attach_name\"nn";
$msg_body .= "$encoded_attachn";
$msg_body .= "--Message-Boundary--n";
}
$extra="-f".$from;
mail("[email protected]", stripslashes($subject), $msg_body, $mailheaders, $extra);
echo "<h3>GRACIAS POR TU COLABORACIÓN</h3>";
?>
Gracias con antelación, esque llevo bastante tiempo intentando hacerlo, pero no puedo salu2