Forum Moderators: coopster
If you have any questions (as to the french stuff), pls just sticky me and I will gladly respond.
- - - - - - - - - - - -
The error message reads:
Warning: Failed to Connect in c:\program_files\easyphp\www\our_site\valide_i.php on line 77
(It is acting as if it were a server error but its not. We are using localhost. The application isn't deployed yet).
------------------
<?php
<modnote>trimmed to relevant code only, as per charter
if ($erreur==0){
// envoie d'un email avec le nom d'usager et le courriel
$sujet= "Demande d'information\n";
$messager="Bonjour,<br>Votre nom d'usager est : $user<br> Votre mot de passe est : $password\n";
echo "$a<br>"."$sujet<br>"." $messager<br>"."$header<br>";
mail($a,$sujet,$messager,$header);
$mess="Un courriel vous<br>sera envoyé";
//redirect("index.php?message=$mess;");
//mail($adressedest,$lobjet,$lemessage,"From: $expediteur\nReply-To: $expediteur\nX-Mailer: PHP/" );
}else {
// initialisation du message
$mess="Donnée invalide, recommencer ou contacter nous";
//redirection vers la page du formulaire login
redirect("info_log.php?message=$mess;");
}
?>
- - - - - - - - - - - - - - - - -
Thanks to anybody that can pull us out of here.
:-)
[edited by: jatar_k at 11:49 pm (utc) on July 3, 2003]
[edit reason] generalized email addresses [/edit]
[ca.php.net...]
The Windows implementation of mail() differs in many ways from the Unix implementation. First, it doesn't use a local binary for composing messages but only operates on direct sockets which means a MTA is needed listening on a network socket (which can either on the localhost or a remote machine). Second, the custom headers like From:, Cc:, Bcc: and Date: are not interpreted by the MTA in the first place, but are parsed by PHP. PHP < 4.3 only supported the Cc: header element (and was case-sensitive). PHP >= 4.3 supports all the mentioned header elements and is no longer case-sensitive.
2 important php.ini settings for windows
[ca.php.net...]
SMTP stringUsed under Windows only: DNS name or IP address of the SMTP server PHP should use for mail sent with the mail() function.
smtp_port intUsed under Windows only: Number of the port to connect to the server specified with the SMTP setting when sending mail with mail(); defaults to 25. Only available since PHP 4.3.0.
1- Eaden, yes we are running it locally on a windows machine. Once it is deployed, it will be on one of our Linux servers.
2- Jatar_K - I didn't know you were in the Montreal area... wow.
Line 77 is this one: mail($a,$sujet,$messager,$header);
Jatar: the last paragraph from PHP Net makes a lot of sense. But does it still apply to us even if we are just running everything locally? Nothing is online yet. If it were, I would understand the error message, but its not.
But it would make sense Jatar
Your toughts?
Thanks
I figure, as eaden also mentioned, that it has no idea where or how to connect to the smtp server and that is what the problem is.
You can probably set it to the actual SMTP server that it will use (as long as it can connect to it) and that will make it easier when you do put it live.