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 * 3 ;
$total_estadia_euros = $total_estadia * 5 ;
$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>• </b>Alojamiento: <b>$tipo_Hotel </b> <b>$nomre_Hotel</b><br />
<b>• </b>Id Alojamiento: $alojar_id<br />
------------------------------------------------------------------------------<br />
<b>HABITACIONES<br />
</b><strong>• Habitacion 1: $nombre_hab;</strong><br />
<strong>• Cantidad habitaciones1:</strong> $cant_hab1 <br />
<strong>• Costo Hab. 1: $precio_hab;</strong><br />
<br />
<strong>• Habitacion 2:$nombre_hab2;</strong> <br />
<strong>• Cantidad habtaciones 2: </strong>$cant_hab2 <br />
<strong>• 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();