Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 15th, 2005, 8:25 PM   #1
theguy0000
Programmer
 
Join Date: Jul 2005
Posts: 73
Rep Power: 4 theguy0000 is on a distinguished road
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>
theguy0000 is offline   Reply With Quote
Old Sep 15th, 2005, 8:36 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
From the manual. You might want to peruse the appropriate sections for additional information.
Quote:
Originally Posted by PHP manual
Return Values

Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.

It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination.
__________________
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
DaWei is offline   Reply With Quote
Old Sep 15th, 2005, 8:46 PM   #3
theguy0000
Programmer
 
Join Date: Jul 2005
Posts: 73
Rep Power: 4 theguy0000 is on a distinguished road
so theres nothing wrong with the code itself?
theguy0000 is offline   Reply With Quote
Old Sep 15th, 2005, 11:15 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Sep 19th, 2005, 11:01 PM   #5
jasper_ferrer
Newbie
 
Join Date: Sep 2004
Posts: 23
Rep Power: 0 jasper_ferrer is on a distinguished road
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.
jasper_ferrer is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:00 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC