Foros del Web » Programando para Internet » PHP »

Problemas con envio de variable por email

Estas en el tema de Problemas con envio de variable por email en el foro de PHP en Foros del Web. Estimados amigos quiero enviar un maeil donde el contenidos del mensaje tienen varibles que estan definidas pero cuando me llega el email me llega $variable ...
  #1 (permalink)  
Antiguo 22/10/2008, 06:48
Avatar de jakuam  
Fecha de Ingreso: abril-2007
Mensajes: 354
Antigüedad: 17 años
Puntos: 0
Problemas con envio de variable por email

Estimados amigos quiero enviar un maeil donde el contenidos del mensaje tienen varibles que estan definidas pero cuando me llega el email me llega $variable y no el valor de esta.
Ademas de enviar el email estas se guardan en la base de datos y eso lo hace perfecto por lo que las ariables si estan definidas .
acontinuacion coloco el codigo a ver si me pueden ayudar.

Código PHP:
//$row_xxxx= datos de una base de datos

$nomre_Hotel=$row_alojamiento['nombre'];
$tipo_Hotel=$row_alojamiento['tipo'];
$nombre_alojar=$row_alojamiento['nombre'];
$tipo=$row_alojamiento['tipo'];
$nombre_hab=$row_Recordset2['nombre'];
$precio_hab=$row_Recordset2['precio'];
$tipo_hab $row_Recordset2['tipo'];
$servicio_hab $row_Recordset2['servicio_hab'];

// habitacion 2
$nombre_hab2=$row_Recordset3['nombre'];
$precio_hab2=$row_Recordset3['precio'];
$tipo_hab2 $row_Recordset3['tipo'];
$servicio_hab2 $row_Recordset3['servicio_hab'];


// datos consulta
$nombre$_GET['nombre'];
$apellido$_GET['apellido'];
$telefono$_GET['telefono'];
$email$_GET['email'];
$pais$_GET['chr_pais'];
$provincia$_GET['chr_provincia'];
$ciudad$_GET['ciudad'];
$consulta$_GET['consulta'];
//datos reserva
$alojar_id $_GET['alojar_id'];
$hab_id1$_GET['hab_id1'];
$hab_id2$_GET['hab_id2'];
$cant_hab1$_GET['cant_hab1'];
$cant_hab2$_GET['cant_hab2'];
$cant_pax $_GET['paxs'];
$cant_dias $_GET['cant_dias'];
$total_dia $_GET['total_dia'];
$total_estadia $_GET['total_estadia'];
$fecha1 $_GET['fecha1'];
$fecha2 $_GET['fecha2'];
$emailhotel $row_alojamiento['email'];
$total_estadia_dolares $total_estadia ;
$total_estadia_euros $total_estadia ;
    
$link "http://www.xxx.com";
$asunto " $hotel :: xxxxxx :: xx.com ";
$mailsrl "[email protected]";

// guardo base de datos
if (isset($_GET['nombre'])) {
  
$insertSQL sprintf("INSERT INTO pedidos (nombre_cliente, email_Cliente, nombre_alojamiento, tipo, cantidad_pasajeros, fecha1, fecha2, telefono_cliente, pais, provincia, ciudad, consulta) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       
GetSQLValueString($nombre"text"),
                       
GetSQLValueString($email"text"),
                       
GetSQLValueString($nombre_alojar"text"),
                       
GetSQLValueString($tipo"text"),
                       
GetSQLValueString($cant_pax"text"),
                       
GetSQLValueString($fecha1"text"),
                       
GetSQLValueString($fecha2,  "text"),
                       
GetSQLValueString($telefono"text"),
                       
GetSQLValueString($pais"text"),
                       
GetSQLValueString($provincia"text"),
                       
GetSQLValueString($ciudad"text"),
                       
GetSQLValueString($consulta"text"));

  
mysql_select_db($database_reservas$reservas);
  
$Result1 mysql_query($insertSQL$reservas) or die(mysql_error());
}

// contenido del mensaje a enviar por email
  
     
$message "
            <div style='font-style:normal; font: Arial '>
      
<spam style='font-style:normal; font: Arial;  '><p>
<span class='style2 style5' style='text-align:center'><b>CONSULTA A $nomre_Hotel</b></span><br />
<br />
<span class='style5'><span> DATOS CLIENTES </span><br />

Nombre:............................. $nombre 
E-Mail:................................. $email 
Telefono:........................... $telefono 
Ciudad:.............................. $ciudad
Provincia:.......................... $provincia 
Pais:................................... $pais 
<br />
CONSULTA<br />
$consulta<<br />
-----------------------------------------------------------------------------
    <br />
    <b> DATOS ESTADIA</b>  <br />
Check In:.......................................... $fecha1 <br />
Check Out:...................................... $fecha2 <br />
Cantidad de Dias de Estadia:.... $dias_estadia><br />
Cantidad de Pasajeros:...............  $paxs <br />
    <br />
    <strong>DATOS DE LA RESERVA </strong><br />
    <b>&bull; </b>Alojamiento: <b>$tipo_Hotel </b> <b>$nomre_Hotel</b><br />
    <b>&bull; </b>Id Alojamiento: $alojar_id<br />
    ------------------------------------------------------------------------------<br />
    <b>HABITACIONES<br />
    </b><strong>&bull; Habitacion 1: $nombre_hab;</strong><br />
    <strong>&bull; Cantidad habitaciones1:</strong> $cant_hab1 <br />
    <strong>&bull; Costo Hab. 1: $precio_hab;</strong><br />
    <br />
    <strong>&bull; Habitacion 2:$nombre_hab2;</strong> <br />
    <strong>&bull; Cantidad habtaciones 2: </strong>$cant_hab2 <br />
    <strong>&bull; Costo Hab. 2: $precio_hab2</strong><br />
    <br />
 
    <strong>COSTO DIARIO <br />
Costo diario Estadia :</strong> $total_dia <br />
<br /> 
<strong>COSTO TOTAL DE LA ESTADIA </strong><br />
<br />
<strong>Pesos ar$</strong> </span><span class='style7'><strong>:</strong></span><span class='style7'> $total_estadia<br />

    <br />
  
  

</div> "
;


         require 
"includes/class.phpmailer.php";
  
$mail = new PHPMailer();
  
$mail->SetLanguage("es","includes/language/");
  
$mail->Host "mail.xxx.com";
$mail->PluginDir "includes/";
$mail->IsHTML(true); 
$mail->FromName $nombre;
$mail->From $email;
$mail->AddReplyTo ($email);
$mail->Subject $asunto;
$mail->AddAddress($mailhotel,$hotel);
$mail->AddBCC("$mailsrl");

//si tu servidor requiere autenticacion, tambien lo siguiente:
$mail->SMTPAuth false;
$mail->Username "xxxx";
$mail->Password "donatxxxxo07";  
$mail->Encoding "quoted-printable";

$mail->Body $message
$result $mail->Send(); 
__________________
Jakuam
Reserva Hoteles Online
Turismo San Rafael Mendoza
  #2 (permalink)  
Antiguo 22/10/2008, 09:08
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Problemas con envio de variable por email

Mmm muy raro, prueba usar echo $message; para ver como se ve en pantalla antes de enviar el mail ya que no te deberia de dar problemas.

Saludos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:42.