sendmail.php

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
htoshmatov
-


Joined: 11 Jul 2003
Posts: 17
Location: Dubuque,Iowa. USA

PostPosted: Fri Aug 29, 2003 4:55 pm    Post subject: sendmail.php Reply with quote

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 View user's profile Send private message Visit poster's website
htoshmatov
-


Joined: 11 Jul 2003
Posts: 17
Location: Dubuque,Iowa. USA

PostPosted: Fri Aug 29, 2003 5:01 pm    Post subject: Reply with quote

and now this erorr comes up
>
Warning: mail(): SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in C:\*****\sendform.php on line 21

>
_________________
We build professional and commercial websites for lower price.
www.htoshmatov.com/links
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Aug 30, 2003 2:48 pm    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail
EvaStar
-


Joined: 17 Dec 2002
Posts: 62
Location: Ontario

PostPosted: Sat Aug 30, 2003 4:28 pm    Post subject: Reply with quote

That our turn your registered_globals in the php.ini file to ON.
Back to top View user's profile Send private message
htoshmatov
-


Joined: 11 Jul 2003
Posts: 17
Location: Dubuque,Iowa. USA

PostPosted: Sat Aug 30, 2003 9:56 pm    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
kodeking
-


Joined: 19 Jun 2003
Posts: 15

PostPosted: Sun Aug 31, 2003 7:27 pm    Post subject: Reply with quote

use echo instead of print
________
Rambler Classic
________
Chevrolet Advance Design Specifications


Last edited by kodeking on Sat Feb 19, 2011 6:35 pm; edited 2 times in total
Back to top View user's profile Send private message
htoshmatov
-


Joined: 11 Jul 2003
Posts: 17
Location: Dubuque,Iowa. USA

PostPosted: Wed Sep 03, 2003 11:21 pm    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Sep 04, 2003 12:48 pm    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail
htoshmatov
-


Joined: 11 Jul 2003
Posts: 17
Location: Dubuque,Iowa. USA

PostPosted: Thu Sep 04, 2003 6:23 pm    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group