![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Jul 2005
Posts: 73
Rep Power: 4
![]() |
email form not working
when i click the button, it says my message was sent but i dont recieve anything.
<html>
<head><title>CodeWiz E-mail form</title></head>
<body>
<?php
$completepage = <<< ENDE
Your message has been sent.
ENDE;
$formpage = <<< ENDE
<form action="?" method="POST">
<input type="hidden" name="send" value="yes">
Sending A message to: $to@codewiz.xemoc.net <p>
Subject: CodeWiz - $to <p>
Message:<br><input type="textarea" rows="3">
<input type="submit" value="submit">
</form>
ENDE;
if(isset($_REQUEST['send'])) {
$message = '';
foreach($_REQUEST as $a => $b) {
if($a == 'send') continue;
$message .= "$a: $b\n";
}
mail($to . "@codewiz.xemoc.net", "CodeWiz - " . $to, $message);
echo $completepage;
} else {
echo $formpage;
}
?>
</body>
</html> |
|
|
|
|
|
#2 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
From the manual. You might want to peruse the appropriate sections for additional information.
Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: Jul 2005
Posts: 73
Rep Power: 4
![]() |
so theres nothing wrong with the code itself?
|
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Well, I didn't say that. I didn't analyze your code at the time, I just recalled problems I had in the past. Now that I look at your code, I see that you aren't even testing the return from "mail." You're issuing the message just on the strength of making the call. Making the call doesn't mean the function worked. It only assures you that it will work OR tell you it didn't. You aren't asking it how it made out. Even if it works, there is no assurance that the rest of the chain functioned properly. It only means it was accepted for delivery. You don't mention your platform, but on Windows you sometimes have to dink with the mail facility in order for it to work *nix-like with the PHP invocation of the basic function.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Sep 2004
Posts: 23
Rep Power: 0
![]() |
is your php installation properly setup to handle smtp? maybe you should check that first. even if you manage to fix that you should also keep in mind that maybe your domain or ip is being blocked on the recipients mail server.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|