Ben her zaman e-posta yoluyla bir form denemek ve göndermek için kullanılan ve ben bu mesajı alıyorum aynı php kod kullanıyorum:
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 sendMailSuscribete.php on line 44
Bu satırları 40 şunlardır: 54 -
$header .= "From: $email" . "\r\n";
$header .= "Reply-To: $email" . "\r\n";
$header .= "Return-Path: $email" . "\r\n";
if(mail($to, $subject, $msg, $header)){
//Message sent!
redirect("http://www.domain.com/suscribete.html");
}else{
// Display error message if the message failed to send
echo "
<div class=\"MsgError\">
<h1>Error…</h1>
<p>Disculpa <b><?=$name;?></b>, tu mensaje falló en ser enviado. Por favor vuelve a intentar.</p>
</div>";
}
Zaten phpinfo()
kullanılarak kontrol ve smtp localhost'tur olduğunu biliyoruz ve kullandığı portu yani gerçekten hata ne olabilir hiçbir fikrim yok 25'tir.
Update I forgot to say it is running on a Windows server and this php file is the one I've always used for Unix servers, should it contain something different?