emailadjunto
que paso denuevo tengo un problemita el problema es que en este escript al pareser todo es correcto pero no me quiere funcionar. espero me puedan ayudar.
<?
if ($sendmail) {
$mailheaders = "Return-Path: $fromn";
$mailheaders .= "From: $fromn";
//$mailheaders = "From: $fromn";
$mailheaders .= "Reply-To: $fromn";
$mailheaders .= "Cc: $ccn";
$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($to, stripslashes($subject), $msg_body, $mailheaders, $extra);
echo "<h3> Se ha enviado el mail correctamente. www.phpmysql.tk </h3><br>";
}
?>
<p class="titulo">Mandar archivos por un formulario</p>
<br>
<form enctype="multipart/form-data" name=doit action="<? echo $_SERVER['REQUEST_URI'] ?>" method=POST>
<table cellpadding=0 cellspacing=0>
<tr>
<td>Tu e-mail:</td>
<td><input type="text" name="from" size=40 class="form"></td>
</tr>
<tr>
<td>Para:</td>
<td><input type="text" name="to" size=40 class="form"></td>
</tr>
<tr>
<td>Copia a:</td>
<td><input type="text" name="cc" size=40 class="form"></td>
</tr>
<tr>
<td>Copia Blindada a:</td>
<td><input type="text" name="bcc" size=40 class="form"></td>
</tr>
<tr>
<td>Fichero:</td>
<td><input type=file name="attach" size=40 class="form"></td>
</tr>
<tr>
<td>Asunto:</td>
<td><input type="text" name="subject" size=40 class="form"> </td>
</tr>
</table>
Mensaje:<br>
<textarea name="body" rows=15 cols=50 wrap="message" class="form">
</textarea>
<br>
<input type="submit" name="sendmail" value="Enviar" class="form">
</form>
no se que hacer....
<?
if ($sendmail) {
$mailheaders = "Return-Path: $fromn";
$mailheaders .= "From: $fromn";
//$mailheaders = "From: $fromn";
$mailheaders .= "Reply-To: $fromn";
$mailheaders .= "Cc: $ccn";
$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($to, stripslashes($subject), $msg_body, $mailheaders, $extra);
echo "<h3> Se ha enviado el mail correctamente. www.phpmysql.tk </h3><br>";
}
?>
<p class="titulo">Mandar archivos por un formulario</p>
<br>
<form enctype="multipart/form-data" name=doit action="<? echo $_SERVER['REQUEST_URI'] ?>" method=POST>
<table cellpadding=0 cellspacing=0>
<tr>
<td>Tu e-mail:</td>
<td><input type="text" name="from" size=40 class="form"></td>
</tr>
<tr>
<td>Para:</td>
<td><input type="text" name="to" size=40 class="form"></td>
</tr>
<tr>
<td>Copia a:</td>
<td><input type="text" name="cc" size=40 class="form"></td>
</tr>
<tr>
<td>Copia Blindada a:</td>
<td><input type="text" name="bcc" size=40 class="form"></td>
</tr>
<tr>
<td>Fichero:</td>
<td><input type=file name="attach" size=40 class="form"></td>
</tr>
<tr>
<td>Asunto:</td>
<td><input type="text" name="subject" size=40 class="form"> </td>
</tr>
</table>
Mensaje:<br>
<textarea name="body" rows=15 cols=50 wrap="message" class="form">
</textarea>
<br>
<input type="submit" name="sendmail" value="Enviar" class="form">
</form>
no se que hacer....
