bonjour
j ai tester hier d'envoyer un mail via la fonction mail() mais sans acune resultat il me donne l'erreur suivante:
.Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in
j lai deja cite ca fait un an et qlq et ca marche et mnt je sais pas ou exactement le prob.
si vous avez trouve la solution contacte moi svp
voila mon scripte "envoyer.php"
et merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 <?php /* * Created on 31 mars 07 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ $adr=$_POST["adrsmail"]; $obj=$_POST["objet"]; $mes=$_POST["message"]; $headers ='From: "taha"<xxxx@hotmail.fr>'."\n"; $headers .='Reply-To: xxxx@hotmail.fr'."\n"; $headers .='Content-Type: text/plain; charset="iso-8859-1"'."\n"; $headers .='Content-Transfer-Encoding: 8bit'; if(mail($adr, $obj,$mes, $headers)) { echo 'Le message a bien été envoyé'; } else { echo 'Le message n\'a pu être envoyé'; } ?>
Partager