View previous topic :: View next topic |
Author |
Message |
htoshmatov -
Joined: 11 Jul 2003 Posts: 17 Location: Dubuque,Iowa. USA
|
Posted: Fri Aug 29, 2003 4:55 pm Post subject: sendmail.php |
|
|
Can anybody tell me why my sendmail fform is not working?
here is source:
My HTML source:
<html>
<head>
<title>
E-mail </title>
</head>
<body>
<form action="sendform.php" method="POST">
Your Name: <INPUT type="text" name="name"><br><br>
Your E-Mail Adress: <INPUT type="text" name="email"><br><br>
Message:<br>
<textarea name="message" cols=30 rows=5> </textarea> <br><br>
<INPUT type="submit" value="Send Form">
</form>
</body>
</html>
This is my PHP form:
<html>
<head>
<title>Send Form </title>
</head>
<body>
<?php
print "Thank you, <b>$_POST[name]</b>, for your message!<br><br>\n\n";
print "Your E-mail Adress is: <b>$_POST[email]</b><br><br>\n\n";
print "Your Message was:<br><br>\n\n";
print "$_POST[message] <br><br>";
//start building the mail string
$msg = "Name: $_POST[name]\n";
$msg .= "E-mail: $_POST[email]\n";
$msg .= "Message: $_POST[message]\n";
//set up the mail
$recipient="habibtoshmatov@yahoo.com";
$subject="Form Submission Results";
$mailheaders="Form: My Web Sites <defaultaddress@yourdomain.com> \n";
$mailheaders .="Reply-to: $_POST[email]";
//send the mail
mail($recipient, $subject, $msg, $mailheaders);
?>
</body>
</html>
_____________________________________________________________________
Thank you guys, I don`t know I would do without you
by the this erorr message I get every time:
>
Notice: Undefined index: name in C:\*******\sendform.php on line 7
Thank you, , for your message!
Notice: Undefined index: email in C:\*******\sendform.php on line 8
Your E-mail Adress is:
Your Message was:
Notice: Undefined index: message in C:\*******\sendform.php on line 10
Notice: Undefined index: name in C:\*******\sendform.php on line 12
Notice: Undefined index: email in C:\******\sendform.php on line 13
Notice: Undefined index: message in C:\******/sendform.php on line 14
Notice: Undefined index: email in C:\******\sendform.php on line 19
Warning: mail(): SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in C:\******\sendform.php on line 21
P.S My PHP is working fine. _________________ We build professional and commercial websites for lower price.
www.htoshmatov.com/links |
|
Back to top |
|
|
htoshmatov -
Joined: 11 Jul 2003 Posts: 17 Location: Dubuque,Iowa. USA
|
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat Aug 30, 2003 2:48 pm Post subject: |
|
|
You should use $_POST['email'] instead of $_POST[email]. The double quotes are important.
Error 451 means that the SMTP server you connected to complaint about the request you made. It is likely to have this error because the previous ones related to how you called the variables. So fix the variables naming issue and retry. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
EvaStar -
Joined: 17 Dec 2002 Posts: 62 Location: Ontario
|
Posted: Sat Aug 30, 2003 4:28 pm Post subject: |
|
|
That our turn your registered_globals in the php.ini file to ON. |
|
Back to top |
|
|
htoshmatov -
Joined: 11 Jul 2003 Posts: 17 Location: Dubuque,Iowa. USA
|
Posted: Sat Aug 30, 2003 9:56 pm Post subject: |
|
|
Thanx guys, lem try once..
i`ll let you know.. :) _________________ We build professional and commercial websites for lower price.
www.htoshmatov.com/links |
|
Back to top |
|
|
kodeking -
Joined: 19 Jun 2003 Posts: 15
|
|
Back to top |
|
|
htoshmatov -
Joined: 11 Jul 2003 Posts: 17 Location: Dubuque,Iowa. USA
|
Posted: Wed Sep 03, 2003 11:21 pm Post subject: |
|
|
I corrected everything just like you guys said early and now I am geting this message:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\*******sendform.php on line 8
________________________________
<html>
<head>
<title>Send Form </title>
</head>
<body>
<?php
echo "Thank you, <b>$_POST[name]</b>, for your message!<br><br>\n\n";
echo "Your E-mail Adress is: <b>$_POST['email']</b><br><br>\n\n";
echo "Your Message was:<br><br>\n\n";
echo "$_POST[message] <br><br>";
//start building the mail string
$msg = "Name: $_POST[name]\n";
$msg .= "E-mail: $_POST[email]\n";
$msg .= "Message: $_POST[message]\n";
//set up the mail
$recipient="habibtoshmatov@yahoo.com";
$subject="Form Submission Results";
$mailheaders="Form: My Web Sites <defaultaddress@yourdomain.com> \n";
$mailheaders .="Reply-to: $_POST[email]";
//send the mail
mail($recipient, $subject, $msg, $mailheaders);
?>
</body>
</html> _________________ We build professional and commercial websites for lower price.
www.htoshmatov.com/links |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Thu Sep 04, 2003 12:48 pm Post subject: |
|
|
Code: |
echo "Thank you, <b>$_POST[name]</b>, for your message!<br><br>\n\n";
|
is wrong. Instead you should use:
Code: |
echo "Thank you, <b>", $_POST['name'], "</b>, for your message!<br><br>\n\n";
|
[/code] _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
htoshmatov -
Joined: 11 Jul 2003 Posts: 17 Location: Dubuque,Iowa. USA
|
Posted: Thu Sep 04, 2003 6:23 pm Post subject: |
|
|
Thanx,
it is great, it worked but when I send the info Norton Antivirus says:
it`s not able to send message because of this:
"451 see http://pobox.com/~djb/docs/smtplf.html"
I donno why.. :(
Thanx again guys.. you`ve been very helpful _________________ We build professional and commercial websites for lower price.
www.htoshmatov.com/links |
|
Back to top |
|
|
|