Problème boite mail en php

Fermé
Pitus38 - 23 juin 2008 à 19:02
graffx Messages postés 6506 Date d'inscription jeudi 22 mars 2007 Statut Contributeur Dernière intervention 24 mars 2019 - 24 juin 2008 à 07:01
Bonjour, a tous le monde, j'ai un problème je vous explique:
J'ai voulut créer un site web et donc j'ai téléchargé un kit graphique. Jusque là tous va bien... =)
Seulement à l'interieur il y a un "formulaire" qui permet d'envoyer des mails mais je n'arrive pas a le faire fonctionner (si vous pouriez m'ader a le faire fonctionner merci) il m'indique 2 érreurs lorsque je clique sur "envoyer":
-Warning: 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 c:\program files\easyphp1-8\www\scripts\email.php on line 13

-Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\scripts\email.php:13) in c:\program files\easyphp1-8\www\scripts\email.php on line 16

voici le code du fichier php:

<?php
require("config.inc.php");
if(isset($_POST['email']) && isset($_POST['nom']) && isset($_POST['commentaires'])) {
$headers = "From: ".$_POST['nom']."<".$_POST['email'].">\r\n";
$headers .= "X-Sender: ".$_POST['email']."\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
$headers .= "X-Priority: 2\r\n";
$headers .= "Return-Path: ".$_POST['email']."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=\"US-ASCII\"\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";

if(mail($to, $titre, $_POST['commentaires'], $headers)) {
header("Location:../".$lienOK);
} else {
header("Location:../".$lienPasOK);
}
} else {
header("Location:../".$lienPasOK);
}
?>


Je suis un novice en programation donc svp parlez moi en "francais" :lol:
Merci d'avance ;)
A voir également:

4 réponses

gigaga Messages postés 2346 Date d'inscription vendredi 20 juin 2008 Statut Membre Dernière intervention 22 août 2014 301
23 juin 2008 à 20:09
Normal si tu n'as pas un serveur SMTP qui ne torune pas!
0
J'utilise Easy PHP mais je sais pas si c'est ce qu'il faut...
0
gigaga Messages postés 2346 Date d'inscription vendredi 20 juin 2008 Statut Membre Dernière intervention 22 août 2014 301
23 juin 2008 à 21:14
non, il faut un serveur SMTP local ou distant!
0
ok merci bcp a toi gigaga
0
graffx Messages postés 6506 Date d'inscription jeudi 22 mars 2007 Statut Contributeur Dernière intervention 24 mars 2019 1 974
24 juin 2008 à 07:01
si je ne me trompe pas, par exemple: webmail
0