Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/08/2003, 09:48
Avatar de asinox
asinox
 
Fecha de Ingreso: enero-2002
Ubicación: Santo Domingo
Mensajes: 2.712
Antigüedad: 22 años, 3 meses
Puntos: 6
Tratando de enviar mail via php...problema..

Bueno cuando trato de enviar el mail , me da este error y el mail no se envia:

Código PHP:
WarningFailed to Connect in c:program fileseasyphpwwwmsenviarm.php on line 87
Gracias por rellenar el formulario
Se ha enviado correctamente
el codigo es el siguiente:

Código PHP:
<?php include('Connections/oMsolution.php'); ?>
<?php
mysql_select_db
($database_oMsolution$oMsolution);
$query_rsEmail "SELECT * FROM carros WHERE Id ='$Id'";
$rsEmail mysql_query($query_rsEmail$oMsolution) or die(mysql_error());
$row_rsEmail mysql_fetch_assoc($rsEmail);
$totalRows_rsEmail mysql_num_rows($rsEmail);
?>
<html>
<head>
<title>Enviar Email desde Base de Datos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php 
if (!$HTTP_POST_VARS){ 
?> 
<form name="form1" method="post" action="<?php $PHP_SELF ?>">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td width="50%">
    <input name="id" type="hidden" id="id" value="<?php echo $row_rsEmail['Id']; ?>">
      <input name="make" type="hidden" value="<?php echo $row_rsEmail['make']; ?>">
      <input name="model" type="hidden" value="<?php echo $row_rsEmail['model']; ?>">
      <input name="price" type="hidden" value="<?php echo $row_rsEmail['price']; ?>"></td>
    <td width="50%">&nbsp;</td>
  </tr>
  <tr>
    <td align="right">Name:</td>
    <td><input name="name" type="text">
    </td>
  </tr>
  <tr>
    <td align="right">Phone:</td>
    <td><input name="phone" type="text">
    </td>
  </tr>
  <tr>
    <td align="right">Email:</td>
    <td><input name="email" type="text">
    </td>
  </tr>
  <tr>
    <td align="right">Payment:</td>
    <td>Cashier Check
        <input type="checkbox" name="checkbox" value="Check">
      Money Transfer
      <input type="checkbox" name="checkbox" value="Transfer">
    </td>
  </tr>
  <tr>
    <td align="right" valign="top">Comments:</td>
    <td valign="top"><textarea name="comments" cols="40" rows="8"></textarea>
    </td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td><input type="submit" name="Enviar" value="Submit">
        <input type="reset" name="reset" value="Reset">
    </td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
<?php
}else{ 
    
//Estoy recibiendo el formulario, compongo el cuerpo 
    
$cuerpo "Formulario enviado\n"
    
$cuerpo .= "Vehicle ID: " $HTTP_POST_VARS["id"] . "\n"
    
$cuerpo .= "Make: " $HTTP_POST_VARS["make"] . "\n";
    
$cuerpo .= "Model: " $HTTP_POST_VARS["model"] . "\n"
    
$cuerpo .= "Name: " $HTTP_POST_VARS["name"] . "\n"
    
$cuerpo .= "Phone: " $HTTP_POST_VARS["phone"] . "\n"
    
$cuerpo .= "Email: " $HTTP_POST_VARS["email"] . "\n"
    
$cuerpo .= "Payment: " $HTTP_POST_VARS["checkbox"] . "\n"
    
$cuerpo .= "Comments: " $HTTP_POST_VARS["comments"] . "\n";

    
//mando el correo... 
    
mail("[email protected]","Formulario recibido",$cuerpo); 

    
//doy las gracias por el envío 
    
echo "Gracias por rellenar el formulario. Se ha enviado correctamente."
}
?>
</body>
</html>
<?php
mysql_free_result
($rsEmail);
?>
La coneccion a la bd no tiene problema..... y en la linea 87 lo que esta es esto:

Código PHP:
mail("[email protected]","Formulario recibido",$cuerpo); 
alguien me le da un vistaso?
__________________
www.dataautos.com

Última edición por asinox; 05/08/2003 a las 09:51