weaver14 de Octubre del 2003
Preguntabueno no tengo mucha idea de php, pero consegui gracias a una amiga un codigo para enviar archivos con un documento adjunto desde una web: dicho documento se envia correctamente pero ese archivo aparte de enviarlo por correo tambien lo almacena en el servidor ¿alguien sabria decirme como hacer para que esto no ocurra y tambien si se puede limitar el tamañao del archivo del envio ?
el codigo es este:
<?php
// Has there been a form submission? If yes, go on and
// process...
if ($action1=="1")
{
// create the mail
$from = sprintf("'%s' <%s>", $name, $email) ;
$sendto = sprintf("'%s' <%s>", $nameto, $emailto) ;
$mime = new MIME_mail($from, $sendto, $subject, $message, "Cc: $email");
// attach image 1 if there...
if ($image1 != "none")
{
$in = $image1_name;
$it = $image1_type;
// upload the file (temp for attaching)
$fname = $in;
$type = (preg_match("!/x-.+!i", $it)) ? OCTET : $it;
copy($image1, $fname);
// attach the image
$mime->fattach($fname, $in, $type);
// clean up our temp image
unlink($image1);
}
// send the mail
$mime->send_mail();
echo "El email se ha enviado correctamente $name, para enviar otro mail pulsa [<a href='".$PHP_SELF."'>aqui</a>]";
}
else
{
?>
el codigo es este:
<?php
// Has there been a form submission? If yes, go on and
// process...
if ($action1=="1")
{
// create the mail
$from = sprintf("'%s' <%s>", $name, $email) ;
$sendto = sprintf("'%s' <%s>", $nameto, $emailto) ;
$mime = new MIME_mail($from, $sendto, $subject, $message, "Cc: $email");
// attach image 1 if there...
if ($image1 != "none")
{
$in = $image1_name;
$it = $image1_type;
// upload the file (temp for attaching)
$fname = $in;
$type = (preg_match("!/x-.+!i", $it)) ? OCTET : $it;
copy($image1, $fname);
// attach the image
$mime->fattach($fname, $in, $type);
// clean up our temp image
unlink($image1);
}
// send the mail
$mime->send_mail();
echo "El email se ha enviado correctamente $name, para enviar otro mail pulsa [<a href='".$PHP_SELF."'>aqui</a>]";
}
else
{
?>
