bueno ante todo muchas gracias a lo expertos de webdesign k gracias a ellos nosotros los novatos podemos aprender cada dia un poco mas..
 
mi problema es el siguiente: sto tratando de envian un email de confirmacion de pedido a una mail. pero no llego a recibir nada quisiera saber en donde me he equivoado..
les agradesco de ante mano. 
 este es el codigo.
 
 ///generando mensaje para el correo electrónico
 
$mensaje = '
<table width=513 border=0 cellspacing=0 cellpadding=0>
<tr>
<td width=9></td>
<td align=center>Nº de Orden:' . $row_rorden[codorden] . '</td>
<td width=9></td>
</tr>
</table>
<table width=513 border=1 cellpadding=0 cellspacing=0 bordercolor=#CCCCCC>
<tr>
<td width=27 height=20 align=center bgcolor=#F9F9F9><p>Nº</p></td>
<td width=206 height=20 align=center bgcolor=#F9F9F9><p>Producto</p></td>
<td width=82 height=20 align=center bgcolor=#F9F9F9><p>Cantidad</p></td>
<td width=82 height=20 align=center bgcolor=#F9F9F9><p>Precio</p></td>
<td width=82 height=20 align=center bgcolor=#F9F9F9><p>Subtotal</p></td>
</tr>';
$contador = 0;
do { 
	$contador = $contador + 1;
	if ($row_rorden[precio_oferta] != 0) {
		 $tPrecio = $row_rorden[precio_oferta];
		 $subtotal = $row_rorden[cantidad] * $row_rorden[precio_oferta];
	} else  {
		 $tPrecio = $row_rorden[precio_normal];	
		 $subtotal = $row_rorden[cantidad] * $row_rorden[precio_normal];
	}	
	$total = $total + $subtotal;
	$igv = $total * 0.19;
	$neto = $total + $igv;	
 
$mensaje = $mensaje . '
 
<tr><td height=20 align=center>' . $contador . '</td>
<td height=20><p>' . $row_rorden[nombrelibro] . '</td>
<td height=20 align=center>' .  $row_rorden[cantidad] . '</td>
<td width=82 height=20 align=right>' .  number_format($tPrecio,2) . '</td>
<td width=82 height=20 align=right>' .  number_format($subtotal,2) . '</td>
</tr>';
} while ($row_rorden = mysql_fetch_assoc($rorden));
$mensaje = $mensaje . '
</table>
<table width=513 border=0 cellspacing=0 cellpadding=0>
<tr><td width=428 height=20 align=right>Sub Total : </td><td width=85 align=right bgcolor=#F9F9F9>'.  number_format($total,2) . '</td></tr>
<tr><td width=428 height=20 align=right>IGV : </td><td width=85 align=right bgcolor=#F9F9F9>'.  number_format($igv,2) . '</td></tr>
<tr><td width=428 height=20 align=right>Neto : </td><td width=85 align=right bgcolor=#F9F9F9>'.  number_format($neto,2) . '</td></tr>
</table>  
<table width=513 border=0 cellspacing=0 cellpadding=0>
<tr><td width=9 height=30></td><td align=center>Datos del Comprador</td><td width=9></td></tr>
</table>
<table width="519" border="1" cellpadding="0" cellspacing="0">
  <tr><td width="40%" height=30 align="right"><p class="precios">Nombre : </p></td><td width="60%">' .  $row_rscliente[nombre] . '</td></tr>
  <tr><td width="40%" height=30 align="right"><p class="precios">Apellido : </p></td><td width="60%">' .  $row_rscliente[apellidos] . '</tr>
  <tr><td width="40%" height=30 align="right"><p class="precios">Razón Social : </p></td><td width="60%">' .  $row_rscliente[razonsocial] . '</td></tr>
  <tr><td width="40%" height=30 align="right"><p class="precios">DNI : </p></td><td width="60%">' .  $row_rscliente[ndi] . '</td></tr>
  <tr><td width="40%" height=30 align="right"><p class="precios">Dirección : </p></td><td width="60%">' .  $row_rscliente[direccion] . '</td></tr>
  <tr><td width="40%" height=30 align="right"><p class="precios">Teléfono : </p></td><td width="60%">' .  $row_rscliente[telefono] . '</td></tr>
  <tr><td width="40%" height=30 align="right"><p class="precios">Email : </p></td><td width="60%">' .  $row_rscliente[email] . '</td></tr>
  <tr><td width="40%" height=30 align="right"><p class="precios">Observaciones : </p></td><td width="60%">' .  $observaciones . '</td></tr>
</table>';
 
$fecha = date("Y-m-d h:i:s A");
$xCliente = $_SESSION['IdCliente'];
$xOrden = $_SESSION['IdOrden'];
 
// Agreando datos a pedido
$sql = "insert into pedidos(codorden,codcliente,fechapedido,observacio  nes,bruto,igv,total) values('$xOrden','$xCliente','$fecha','$observacio  nes','$total','$igv','$neto')";
$result = mysql_query($sql);	
 
// Agreando datos a detalle de pedido
 
$colname1_rorden = "-1";
if (isset($xCliente)) {
  $colname1_rorden = (get_magic_quotes_gpc()) ? $xCliente : addslashes($xCliente);
}
$colname_rorden = "-1";
if (isset($xOrden)) {
  $colname_rorden = (get_magic_quotes_gpc()) ? $xOrden : addslashes($xOrden);
}
$query_rorden = sprintf("SELECT b.codorden, b.codproducto, p.nombreproduc, b.cantidad, p.precio_normal, p.precio_oferta FROM carrito as b, clientes as c, productos as p WHERE b.codorden = '%s' and b.codcliente=c.codcliente and b.codcliente='%s' and b.codproducto=p.codproducto", $colname_rorden,$colname1_rorden);
$rorden = mysql_query($query_rorden, $cbdtienda_alison) or die(mysql_error());
$row_rorden = mysql_fetch_assoc($rorden);
$totalRows_rorden = mysql_num_rows($rorden);
do { 
	$xProducto = $row_rorden[codproducto];
	if ($row_rorden[precio_oferta] != 0) {
		 $xPrecio = $row_rorden[precio_oferta];
	} else  {
		 $xPrecio = $row_rorden[precio_normal];	
	}	
	$xCantidad = $row_rorden[cantidad];
	$sql = "insert into pedidodetalle(codorden,codproducto,precio,cantidad  ) values('$xOrden','$xProducto','$xPrecio','$xCantid  ad')";
	$result = mysql_query($sql);
} while ($row_rorden = mysql_fetch_assoc($rorden));
 
// Borrando registros del carrito
$sql = "delete from carrito where codorden='$xOrden' and codcliente='$xCliente'";
$result = mysql_query($sql);
 
$_SESSION['IdOrden'] = "";
unset($_SESSION['IdOrden']);
 
 // datos de correo para el envio de pedido
 
$sendTo = "mi correo";
$subject = "Orden de Pedido N° " . $xOrden;
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: " . $row_rscliente[email];
$headers .= "<" . $row_rscliente[email] . ">\r\n";
$headers .= "Reply-To: " . $row_rscliente[email]; 
$message = $mensaje;
mail($sendTo, $subject, $message, $headers); 
 
header("Location: confirmar_envio.php");
?> 
   
 



