Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm not a Linux guru, but I can get around. I'm having problems getting the mail() function to work for me on this one server. It's at work and therefore behind some sort of a firewall (not sure if that has any anything to do with this problem). As far as the local box is concerned, I have disabled it's firewall, etc.
The box has Fedora Core 6 installed (with PHP 5.1.6). Here is the code. I have verified that this works on a different server of mine outside of this network. Here is the code:
[b]index.php[/b] - An HTML form that asks the user to specify an email address.
[syntax="html"]
<html>
<head>
<title>This is an email test...</title>
</head>
<body>
<form action="./email_test.php" method="post">
Email Address: <input type="text" name="email" maxlength="64"> <input
type="submit" value="Send" name="email_send">
</form>
</body>
</html>
Code: Select all
<?php
$email = $_POST['email'];
$to = $_POST['email'];
$subject = 'Testing... 1... 2... 3';
$message = 'This is a test from the GTK-DEV server. If you did NOT
recieve this email please send xxx@yyy.com a response. ';
$headers = 'From: xxx@yyy.com' . "\r\n" .
'Reply-To: xxx@yyy.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$retVal = mail($to, $subject, $message, $headers);
if($retVal) {
echo "Your email message was sent successfully!!!<br><br>";
} else {
echo "ERROR: Your email message was NOT sent!!!<br><br>";
echo " <b>Email</b>: " . $to . "<br>";
echo " <b>Title</b>: " . $subject . "<br>";
echo " <b>Message</b>: " . $message;
}
?>Code: Select all
ERROR: Your email message was NOT sent!!!
Email: someone@gmail.com
Title: Testing... 1... 2... 3
Message: This is a test from the GTK-DEV server. If you did NOT recieve this email please send xxx@yyy.com a response.Are there any ideas on what could be causing this. Are there certain PHP packages that I should make sure are installed, or any configuration in php.ini that I can alter. I just wish I had better error messages to debug this... are there other ways to test this functionality to determine the root of the problem?
Thanks for your help,
Trey
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]