Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/01/2011, 12:43
breaststroke
 
Fecha de Ingreso: octubre-2010
Mensajes: 189
Antigüedad: 13 años, 6 meses
Puntos: 0
php mail(QK SMTP/xampp) no funciona:(

Hola , un saludo a todos!.

Estoy intentando implementar la función mail de php pero no consigo que funcione.
He estado indagando y no consigo ver donde está el fallo.

Este es mi código php:

Código PHP:
..
 
$mensaje=" $name,Hello. /n
           This is your password= $password./n
           You should clink on the next/n
           link in order to confirm your registration: /n
           http://www.myweb.com./n
           com/confirmar.php?codigo=$codigoverificacion;"



ini_set("SMTP","localhost");
ini_set("smtp_port","25"); 

$asunto"Confirmation of your registration to our website";
$headers  'MIME-Version: 1.0' "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";
$headers .= "From: Pepe<postmaster@localhost>\r\n"


mail($mail,$asunto,$mensaje,$headers);
if(
mail($mail,$asunto,$mensaje,$headers))

 echo 
"Se ha enviado un mensaje a tu correo electronico con el código de activación.";
}
else

echo 
"Ha ocurrido un error y no se puede enviar el correo"

.. 
Y estos son los mensajes de error que me aparecen:

(

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 I:\xampp\htdocs\mail.php on line 1061

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 I:\xampp\htdocs\mail.php on line 1062
Ha ocurrido un error y no se puede enviar el correo

)


La línea 1062 es la de if(mail(..
En la configuración php.ini tengo lo siguiente:


[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = 127.0.0.1
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost


Estoy trabajando desde mi localhost.
Tengo instalado QK SMTP.
Alguna idea?

Un saludo!!