Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/06/2009, 17:28
morfeoatm
 
Fecha de Ingreso: abril-2003
Mensajes: 10
Antigüedad: 21 años, 11 meses
Puntos: 0
Formulario no envia archivo adjunto a correo

Que tal, tengo un formulario desde el cula intento enviar un archivo adjunto a un correo, todos los datos pasan bien y del archivo solo pasa la ruta de donde esta en la pc, pero no llega el archivo como adjunto. aqui abajo pongo los codigos de mi formulario y el codigo del archivo .php los cuales uso para el formulario. Que me estara faltando ? Agradezco de antemano sus respuestas.


CODIGO DEL FORMULARIO

CODIGO DEL FORMULARIO
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="es">
<title>Formulario de Prueba Triara</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="Microsoft Theme" content="sandston 011, default">
<meta name="Microsoft Border" content="tlb, default">
</head>
<!--msnavigation-->
<!--msnavigation--><body background="../images/fondo.JPG">
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td valign="top" width="1%"><!--mstheme-->
<font face="Arial, Helvetica">
<p>
<font size="2" face="Verdana">
</font>
</p>
<!--mstheme-->
</font>
</td>
<td valign="top" width="24"></td>
<!--msnavigation--><td valign="top"><!--mstheme-->
<font face="Arial, Helvetica">
<!--*****METODO FORM****-->
<p align="center"><strong><font face="Verdana, Arial, Helvetica, sans-serif">Para informes o ventas contacta con nuestro departamento de Ventas </font></strong></p>
<form action="enviaphp.php" method="post" enctype="multipart/form-data">
<h3>Comentarios<span lang="es-mx">:</span></h3>
<p class="MsoNormal">
<span style="font-family: Verdana; font-weight: 700">Tus comentarios, dudas o solicitud de informes las puedes enviar desde aquí:</span></p>
<blockquote><p><textarea name="comentarios" rows="10" cols="45"></textarea> </p></blockquote>
<h3>Información de contacto</h3>
<!--mstheme-->
</font>
<table>
<tr><td align="right"><!--mstheme-->
<font face="Arial, Helvetica"><em>Nombre</em><!--mstheme--></font></td><td><!--mstheme-->
<font face="Arial, Helvetica"><input type="text" name="nombre" value size="35"><!--mstheme--></font></td></tr>

<tr><td align="right"><!--mstheme-->
<font face="Arial, Helvetica"><em>Teléfono</em><!--mstheme--></font></td><td><!--mstheme-->
<font face="Arial, Helvetica"><input type="text" name="tel" value size="35"><!--mstheme--></font></td></tr>

<tr><td align="right"><!--mstheme-->
<font face="Arial, Helvetica"><em>Correo Electrónico</em><!--mstheme--></font></td><td><!--mstheme-->
<font face="Arial, Helvetica"><input type="text" name="correo" value size="35"><!--mstheme--></font></td></tr>

</table>

<!--mstheme--><font face="Arial, Helvetica"> Apodo
<label>
<input name="apod" type="text" id="apod" size="150">
</label>
<p>Curriculum
<label>
<input name="miarchivo" type="file" id="miarchivo">
</label>
</p>
<p>
<input type="SUBMIT" NAME= "Send" value="Enviar Formulario">
<input type="RESET" value="Borrar Formulario">
</p>

</form>

<!--*****SE CIERRA METODO FORM****-->

<p>
<span style="font-size: 12.0pt; font-family: Verdana; font-weight: 700">Gracias por contactarnos, pronto estaremos en contacto contigo.</span></p>

<!--mstheme--></font><!--msnavigation-->
</td>
</tr><!--msnavigation-->
</table><!--msnavigation-->

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td>&nbsp;</td>
</tr><!--msnavigation--></table>

</body>

</html>


CODIGO DEL ARCHIVO .PHP


<?php
// Funciona para Windows y UNIX. Formato Texto Plano
// El archivo class.smtp.inc no necesita cambios.
// El archivo PHP es el que debe de ser modificado para recibir
// las variables de la forma en HTML.

include('class.smtp.inc');
header('Content-Type: text/plain');

// Poner todas las variables HTML sobre la variable $message.

$hoy = date ("d F Y");
//$message = "\t\t\t$hoy\n\n";
$message = $message . "Comentarios:\n";
$message = $message . "$comentarios\n\n";
$message = $message . "Nombre: $nombre\n";
$message = $message . "Teléfono: $tel\n\n";
$message = $message . "Correo Electrónico: $correo\n";
$message = $message . "Apodo: $apod\n";
$message = $message . "Curriculum: $miarchivo\n";

//$message = $message . "Operaciones Prodigy Hosting.";


/***************************************
** Setup some parameters which will be
** passed to the smtp::connect() call.
***************************************/

/***************************************
** FAVOR DE VIRIFICAR LOS DATOS QUE ACONTINUACIÓN SE PONEN
***************************************/


$params['host'] = 'smtp.midominio'; // Cambiar por su nombre de dominio
$params['port'] = 25; // The smtp server port
$params['helo'] = 'midominio'; // Cambiar por su nombre de dominio
$params['auth'] = TRUE; // Whether to use basic authentication or not
$params['user'] = 'micorreo'; // Correo que utilizara para enviar los correos (no usar el de webmaster por seguridad)
$params['pass'] = 'clavedecorreo'; // Password de la cta de correo. Necesaria para la autenticacion



/***************************************
** These parameters get passed to the
** smtp->send() call.
***************************************/

/***************************************
** FAVOR DE VIRIFICAR LOS DATOS QUE ACONTINUACIÓN SE PONEN
***************************************/

$send_params['recipients'] = array('micorreo'); // The recipients (can be multiple), separados por coma.

$send_params['headers'] = array(
'From: "micorreo" <micorreo>', // Headers
'To: micorreo', 'Subject: Correo de Comentarios'
);

$send_params['from'] = 'micorreo'; // This is used as in the MAIL FROM: cmd
// It should end up as the Return-Path: header
$send_params['body'] = $message; //Message // The body of the email


/***************************************
** The code that creates the object and
** sends the email.
***************************************/

/***************************************
** FAVOR DE VIRIFICAR LOS DATOS QUE ACONTINUACIÓN SE PONEN
** CAMBIAR "PRUEBA" POR SU DOMINIO
***************************************/


if(is_object($smtp = smtp::connect($params)) AND $smtp->send($send_params)){
Header("Location: mipaginaweb"); // PONER EL NOMBRE DEL DOMINIO y verificar en donde se encuentra el archivo ok.htm. (pagina despues de anviarformulario)
exit;

// Any recipients that failed (relaying denied for example) will be logged in the errors variable.
//print_r($smtp->errors);

}else{
Header("Location: mipaginaweb");// PONER EL NOMBRE DEL DOMINIO y verificar en donde se encuentra el archivo bad.htm. (pagina si fallo el envio)
exit;

// The reason for failure should be in the errors variable
//print_r($smtp->errors);
}
?>



Hirotaro