|
-
Aug 3rd, 2002, 10:54 PM
#1
Thread Starter
Lively Member
mail()
hey all,
i am trying to use the mail() function but i keep getting this error
Warning: Failed to Connect in C:\www\root\contact_php\webmaster.php on line 3
and here is the code.
PHP Code:
<?
if(isset($HTTP_POST_VARS['message'])) {
mail('[email protected]',$_REQUEST['subject'],$_REQUEST['message'] . '\n\nFrom,\n' . $_REQUEST['from_name'],'From: ' . $_REQUEST['from_email']);
echo "<b><center>Mail sent!</center></b><br>\n<a href=\"index.php\">Return to home</a><br>\n";
} else {
?>
<center><b>Email |DJ| P@CkMaN</b></center>
<form method="post" action="contact.php?action=webmaster">
Your name: <input type="text" name="from_name" size="35"><br>
Your email: <input type="text" name="from_email" size="35"><br>
Subject: <input type="text" name="subject" size="39"><br>
Message:<br>
<textarea rows="15" cols="38" name="message"></textarea><br>
<input type="image" src="../images/buttons/submit.gif" value="Submit" alt="Submit!" name="submit">
<?
}
?>
please help me,
thanks
There's something I've noticed in the last year or so...
Australian's are good at EVERYTHING !!!
-
Aug 4th, 2002, 04:19 AM
#2
PowerPoster
Don't you have problem with echo() instead of mail()?
PHP Code:
echo "<b><center>Mail sent!</center></b><br>\n<a href=\'index.php\'>Return to home</a><br>\n";
-
Aug 4th, 2002, 11:18 AM
#3
Fanatic Member
Originally posted by abdul
Don't you have problem with echo() instead of mail()?
PHP Code:
echo "<b><center>Mail sent!</center></b><br>\n<a href=\'index.php\'>Return to home</a><br>\n";
No, his echo statement is correct.
DJ P@CkMaN
Are you running this script locally or on a server?
-
Aug 4th, 2002, 12:01 PM
#4
Fanatic Member
cpradio I think you I know where you are going, but if it was local, and he did not configure php.ini
The error would be "unknown" not "cannot connect" at least it is for me.
-
Aug 4th, 2002, 03:34 PM
#5
PowerPoster
Originally posted by cpradio
No, his echo statement is correct.
DJ P@CkMaN
Are you running this script locally or on a server?
Ah ya, I didn't look at the slashes before inside quotes.
-
Aug 4th, 2002, 10:48 PM
#6
Thread Starter
Lively Member
There's something I've noticed in the last year or so...
Australian's are good at EVERYTHING !!!
-
Aug 5th, 2002, 05:37 AM
#7
Fanatic Member
Well I have to say this just b/c it may be the root of your problem.
Open your php.ini file and do a Find for the word "mail" (any case)
Make sure you have it all set properly. Including the send_mb and mail configurations.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|