Foros del Web » Programando para Internet » PHP »

URGENTE mail from php

Estas en el tema de URGENTE mail from php en el foro de PHP en Foros del Web. este es mi codigo de un carrito de compras, lo que quiero hacer es enviar por mail el resultado que valla acumulando el carrito de ...
  #1 (permalink)  
Antiguo 11/06/2003, 19:10
Avatar de gaitagarcia  
Fecha de Ingreso: julio-2002
Mensajes: 79
Antigüedad: 21 años, 9 meses
Puntos: 0
Mensaje URGENTE mail from php

este es mi codigo de un carrito de compras, lo que quiero hacer es enviar por mail el resultado que valla acumulando el carrito de compras.

Código:
<?php
session_start();
if ($item){
	if (!isset($itemsEnCesta)){
		$itemsEnCesta[$item]=$cantidad;
	}else{
		foreach($itemsEnCesta as $k => $v){
			if ($item==$k){
			$itemsEnCesta[$k]=$nuevacant;
			$encontrado=1;
			}
		}
		if (!$encontrado) $itemsEnCesta[$item]=$cantidad;
	}
}
?>
<html>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<body><img src="images/shop.jpg"><br>
<hr size="1" noshade>
<table width="450" border="0" cellpadding="0" cellspacing="0">
  <?php
if (isset($itemsEnCesta)){
	?>
  <tr> 
    <td bgcolor="#7F9DB8"><img src="images/producto.jpg" width="132" height="20"></td>
    <td width="60" bgcolor="#7F9DB8"><img src="images/cantidad.jpg" width="60" height="20"></td>
    <td width="60" bgcolor="#7F9DB8"><img src="images/precio.jpg" width="60" height="20"></td>
    <td width="71" bgcolor="#7F9DB8"> 
      <div align="right"><img src="images/total.jpg" width="60" height="20"></div></td>
  </tr>
  <?php foreach($itemsEnCesta as $k => $v){
	
$colname_DADA = "1";
mysql_select_db($database_ai_db, $ai_db);
$query_DADA = "SELECT * FROM productos WHERE Id = '$k'";
$DADA = mysql_query($query_DADA, $ai_db) or die(mysql_error());
$row_DADA = mysql_fetch_assoc($DADA);
$totalRows_DADA = mysql_num_rows($DADA);
$producto = $row_DADA['producto'];?>
  <?php
	if($vprecio=="" or $vprecio=="Contado"){
$precio = $row_DADA['precio'];
$cuotas = "$";
$cuo = "1";
}
else
if($vprecio=="Plan1"){
$precio = $row_DADA['plan1'];
$cuotas = "3 cuotas de $";
$cuo = "3";}
else
if($vprecio=="Plan2"){
$precio = $row_DADA['plan2'];
$cuotas = "15 cuotas de $";
$cuo = "15";}
?>
  <tr> 
    <td width="260" valign="middle" bgcolor="DFE6ED"> 
      <p><font size="1" face="Verdana"><a href="bd/consultas/borrarprod.php?item=<?php echo $k ?>"><img src="images/borrar.jpg" width="54" height="24" border="0" align="absmiddle"></a>&nbsp;<font color="#000000" face="Arial"><a href="index.php?Center=/bd/consultas/xcadauno.php&Id=<?php echo $k;?>"><font color="#000000"><?php echo $row_DADA['producto']; ?><?php echo $row_DADA['marca']; ?><?php echo $row_DADA['modelo']; ?></font></a></font></font> </p></td>
    <td width="60" valign="middle" bgcolor="DFE6ED"> 
      <form name="form1" method="post" action="index.php?Center=bd/consultas/shop.php&item=<?php echo $row_DADA['Id']; ?>&cantidad=<?php echo $nuevacant; ?>&vprecio=<?php $vprecio; ?>" style="word-spacing: 0; text-indent: 0; line-height: 100%; margin: 0">
        <font size="1" face="Verdana"> &nbsp; 
        <input name="nuevacant" type="text" value="<?php echo $v; ?>" size="3" style="border-style: solid; border-width: 1; font-family:Verdana; font-size:8pt">
        </font> </form></td>
    <td width="60" valign="baseline" bgcolor="DFE6ED"><font size="1" face="Verdana"><?php echo $cuotas ?><?php echo $precio*$v; ?></font></td>
    <td width="71" valign="baseline" bgcolor="DFE6ED"><font size="1" face="Verdana"> 
      &nbsp;$ 
      <?php $Total = $precio*$v*$cuo; $totalfin = $totalfin+$Total; ?>
      <?php echo $Total; ?></font></td>
  </tr>
  <tr> 
    <td colspan="4" valign="middle" bgcolor="#FFFFFF"><font size="1" face="Verdana"><img src="images/blank.gif" width="54" height="2" border="0" align="middle"></font></td>
  </tr>
  <?php 
	}
}
?>
  &nbsp; 
  <tr> 
    <td height="25" bgcolor="7F9DB8"><font size="1" face="Verdana"> <img src="images/formadepago.jpg" width="92" height="24" align="absmiddle"> 
      <select name="menu1" onChange="MM_jumpMenu('parent',this,0)" style="border-style: solid; border-width: 1; font-family:Verdana; font-size:8pt">
        <option value="index.php?Center=bd/consultas/shop.php&vprecio=" selected><?php echo $vprecio; ?></option>
        <option value="index.php?Center=bd/consultas/shop.php&vprecio=Contado">Contado</option>
        <option value="index.php?Center=bd/consultas/shop.php&vprecio=Plan1">Plan1</option>
        <option value="index.php?Center=bd/consultas/shop.php&vprecio=Plan2">Plan2</option>
      </select>
      </font></td>
    <td bgcolor="7F9DB8">&nbsp;</td>
    <td bgcolor="7F9DB8"> <div align="right"><img src="images/totalf.jpg" width="49" height="24"></div></td>
    <td bgcolor="DFE6ED"><font size="1" face="Verdana">&nbsp;$&nbsp;<?php echo $totalfin; ?></font></td>
  </tr>
  <tr> 
    <td colspan="4" valign="middle" bgcolor="#FFFFFF"><font size="1" face="Verdana"><img src="images/blank.gif" width="54" height="2" border="0" align="middle"></font></td>
  </tr>
  <tr> 
    <td height="24" bgcolor="7F9DB8"><a href="index.php"><img src="images/seguircomprando.jpg" width="128" height="24" border="0"></a></td>
    <td height="24" colspan="3" bgcolor="7F9DB8"> <p align="right"><a href="index.php?Center=/bd/consultas/borrarshop.php"><img src="images/cancelar.jpg" width="76" height="24" border="0"></a><a href="index.php?Center=/bd/consultas/estaono.php"><img src="images/confirmar.jpg" width="76" height="24" border="0"></a></p></td>
  </tr>
</table>
<br>
<?php echo 'Center=';echo $Center; ?></body>
</html>
  #2 (permalink)  
Antiguo 12/06/2003, 04:41
xup
 
Fecha de Ingreso: abril-2003
Mensajes: 15
Antigüedad: 21 años
Puntos: 0
puedes utilizar esto

mail($email,$asunto,$mensaje,"From: [email protected]");
__________________
;-)
  #3 (permalink)  
Antiguo 12/06/2003, 07:14
Avatar de gaitagarcia  
Fecha de Ingreso: julio-2002
Mensajes: 79
Antigüedad: 21 años, 9 meses
Puntos: 0
si, esa es la idea, pero como formateo el texto, hay cosas que estan en php y otras que estan en html.

Mi problema es que cuando pongo por ejemplo

<?php
$mensaje= "aca teoricamente tendria que ir todo el codigo, pero que hago con todos los codigos, html y java?" y cuando tengo definidos colores que tambien me pone entre "" a los colores que hago?"

HELP

PLEASE
  #4 (permalink)  
Antiguo 12/06/2003, 07:36
Ex Colaborador
 
Fecha de Ingreso: junio-2002
Mensajes: 9.091
Antigüedad: 21 años, 10 meses
Puntos: 16
Hola,

Para mandar un email en formato HTML, revisa la FAQ http://www.forosdelweb.com/showthrea...350#post254350 . Y sobre como poner " dentro de comillas revisa el manual oficial http://es2.php.net/manual/en/language.types.string.php

Saludos.
__________________
Josemi

Aprendiz de mucho, maestro de poco.
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 17:57.