Tema: Funcion Mail
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/08/2010, 07:56
Zendar
 
Fecha de Ingreso: agosto-2010
Mensajes: 67
Antigüedad: 13 años, 9 meses
Puntos: 0
Funcion Mail

Hola. Tengo este codigo para mandar un formulario por mail:
Código PHP:
Ver original
  1. $para .= '[email protected]';
  2.  
  3.  
  4. $titulo = 'Envio de mail';
  5.  
  6.  
  7. $mensaje = '
  8. <html>
  9. <head>
  10. </head>
  11. <body>
  12. </body>
  13. </html>
  14. ';
  15.  
  16.  
  17. $cabeceras  = 'MIME-Version: 1.0' . "\r\n";
  18. $cabeceras .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  19.  
  20.  
  21. $cabeceras .= 'From: $remitente ' . "\r\n";
  22.  
  23.  
  24. mail($para, $titulo, $mensaje, $cabeceras);

Quiero saber si en $mensaje =
puedo poner codigo php? en ese caso como lo hago?
Gracias!
El codigo que quiero poenr es el siguiente:
Código PHP:
Ver original
  1. <?php
  2. $total = $_POST['total'];
  3. for($x=0;$x<=$total;$x++){
  4.     if($_POST['checkbox_'.$x]=='1'){
  5.        
  6.         $cant = count($carro);
  7.         $carro[$cant]['id'] = $_POST['id_'.$x];
  8.         $carro[$cant]['cantidad'] = $_POST['precio_'.$x];
  9.     }
  10. }
  11.  
  12. $_SESSION['carro']=$carro;
  13.  
  14. ?>
  15. <table width="500" border="1" cellpadding="1" cellspacing="1">
  16.   <tr>
  17.     <th>Producto</th>
  18.     <th>Cantidad</th>
  19.     <th>Precio</th>
  20.     <th>SubTotal</th>
  21.     <th>&nbsp;</th>
  22.   </tr>
  23.   <?php
  24. $cantidad = count($carro);
  25.  
  26. for($x=0;$x<=$cantidad;$x++){
  27.     $SQL = "SELECT * FROM precios WHERE id = ".$carro[$x]['id'].";";
  28.     $registro= mysql_query($SQL,$mcon);
  29.     $f=mysql_fetch_assoc($registro);
  30.     $subtotal = $f['precio']*$carro[$x]['cantidad'];
  31.     if($f['id']){
  32.     ?><tr>
  33.         <td><?php echo $f['nombre'];?></td>
  34.         <td><?php echo $carro[$x]['cantidad'];?></td>
  35.         <td><?php echo $f['precio'];?></td>
  36.         <td><?php echo $subtotal;?></td>
  37.         <td>
  38.         </td>
  39.         </tr>
  40. <?