Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/10/2009, 19:24
zenen
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: email con PHP y variables

hola: no soy experto en php, solo se cosas muy basicas. prueba con esto:

<?php
mail($correo_empresa,$asunto,$pedido,"MIME-Version:1.0\nContent-type:text/html;charset=UTF-8\nFrom:$empresa<$correo_empresa>");
$pedido=" Consulta hecha en MIWEB <br><br>";
$nombre=$_GET["nombre"];
$apellido=$_POST["apellidos"];
$direccion=$_POST["direccion"];
$codigo=$_POST["codigo"];
$ciudad=$_POST["ciudad"];
$provincia=$_POST["provincia"];
$telefono=$_POST["telefono"];
$email=$_POST["correo"];

$pedido .= "<br><br> <u><strong> DATOS DE LA CONSULTA :
</strong></u>" . "<br><br> <strong>Nombre : </strong> $nombre
<br><br> <strong>
Apellidos : </strong>$apellido;
<br><br> <strong>
Direccion de envio : </strong> $direccion;
<br><br> <strong>
Codigo Postal : </strong> $codigo ;
<br><br> <strong>
Ciudad : </strong> $ciudad ;<br><br> <strong>
Provincia : </strong> $provincia; <br><br> <strong>
Teléfono : </strong> $telefono <br><br> <strong>
Email : </strong> $email;<br><br><u><strong> En menos de 12 horas nos pondremos en contacto con husted";



$asunto="Su consulta hecha en miweb";
$empresa="MIWEB";
$correo_empresa="[email protected]";


pero me da este error a mi:


Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in E:\xampp\htdocs\gracias-contacto.php on line 4