Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/10/2009, 21:43
kirst
 
Fecha de Ingreso: septiembre-2009
Mensajes: 230
Antigüedad: 14 años, 7 meses
Puntos: 2
[Ayuda] Mandando email desde form

Código PHP:
<?php

include_once("m/class.phpmailer.php");

$mail = new PHPMailer();
$mail->IsSMTP();                                            // set mailer to use SMTP
$mail->Host =        "localhost";                            // specify main and backup server
//$mail->Port =         80;                                   // set the SMTP port for the GMAIL server
//$mail->SMTPSecure = "ssl";                                // sets the prefix to the servier
$mail->SMTPAuth =    true;                                    // turn on SMTP authentication
$mail->Username =    "[email protected]";        // SMTP username
$mail->Password =    "";                            // SMTP password

/*$mail->IsSMTP();
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port       = 465;                   // set the SMTP port for the GMAIL server
$mail->Username = '[email protected]';
$mail->Password = '';*/

//definimos las variables del formulario
$alt1        =    $_POST["ciudad"];
$alt2        =    $_POST["domicilio"];
$alt3        =    $_POST["provincia"];
$alt4        =    $_POST["te"];
$alt5        =    $_POST["consulta"];
$asunto        =    $_POST["asunto"];
$email        =    $_POST["email"];
$nombre        =    $_POST["nombre"];

//damos formato al cuerpo del mail a enviar
$cuerpo     "Formulario enviado\n";
$cuerpo     .= "Ciudad: " $ciudad "\n";
$cuerpo     .= "Domicilio: " $domicilio "\n";
$cuerpo     .= "Provincia: " $provincia "\n";
$cuerpo     .= "Telefono: " $te "\n";
$cuerpo     .= "Consulta: " $consulta "\n";

$mail->From "$email";
$mail->FromName    "$nombre";    
$mail->AddReplyTo("$email","$nombre");
$mail->AddAddress("[email protected]");

$mail->WordWrap 50;                                 // set word wrap to 50 characters
$mail->IsHTML(true);                                  // set email format to HTML
$mail->Subject "$asunto";//"prueba_asunto"
$mail->Body    "$cuerpo";//"prueba_cuerpo";

if(!$mail->Send()) //si el mail no logra enviarse, procedemos:
{
   echo (
'<div><p aling="center">Consulta no enviada, reintentalo más tarde o contacta al administrador del sitio. Error: <br /> ' $mail->ErrorInfo '</p></div>');
   exit;
}    
else
{
   echo (
'<div><p aling="center">Consulta enviada correctamente!</p></div>');
}
?>
Alguien ve un error ahí??? Cuando mando el form y se ejecuta la función, dice que está mal mandados los "recipientes", calculo yo que son las variables. Este es el error:

Código PHP:
Consulta no enviadareintentalo más tarde o contacta al administrador del sitioError:
Language string failed to loadrecipients_failed 

Saludos.

Última edición por GatorV; 14/02/2014 a las 12:14