problems with an email form

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


Joined: 13 Nov 2002
Posts: 7

PostPosted: Wed Nov 27, 2002 4:47 pm    Post subject: problems with an email form Reply with quote

OK I have this form which I want to email the output.

The form code is....
<FORM ACTION="sendmail.php" METHOD=POST>
<p>Your name:
<br><INPUT TYPE=TEXT NAME="name" size="49">
<p>Your email address:
<br><INPUT TYPE=TEXT NAME="email" size="49">
<p>Your question:
<br><textarea rows="4" name="question" cols="49"></textarea>
<p><INPUT TYPE=SUBMIT VALUE="Send">
</FORM>

My php script is.....
<?php
$msg = "Sender Name:\t$name\n";
$msg .= "Sender E-Mail:\t$email\n";
$msg .= "Question:\t$question\n\n";
$recipient = "m_k-shannon@yahoo.co.uk";
$subject = "Submitted FAQ";
$mailheaders = "From: My Web Site <> \n";
$mailheaders .= "Reply-To: $email\n\n";
mail($recipient, $subject, $msg, $mailheaders);
?>

and the response I get is this....
Warning: Failed to connect to mailserver, verify your "SMTP" setting in php.ini in C:\Abyss Web Server\htdocs\sendmail.php on line 17

I have configured PHP on the server and have run a few basic scripts - ie outputting the form fields to another page using php.

BUT a few questions with this problem....
1) is my script in the correct folder.
2) in theory should the script do what I want it to i.e) send it to my email.
3) Do I have to configure anything else to get it working properly?
4) What is my smtp?

I did get the source from the net as I am new to php and too impatient to learn it all (for now)!!

Oh and one more thing. I am using this server for now to design my site before I register and buy one. (Not sure if that makes a difference with the smtp thingy!!! lol)


Many thanks in advance
Back to top View user's profile Send private message
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Wed Nov 27, 2002 9:48 pm    Post subject: Reply with quote

1) Yep
2) Yep it should, the script works fine
3) Yep, open your php.ini(which is probably in the directory where you installed php, or when your php doesnt do wat it should do(like mine): in c:/windows/, otherwise just search it by useinf the serach machine built in windows... then to edit it: search in the file for "smtp", you will find the rest(mailform=your email, smt_server=your smtp server, explained in 4.))
4) That is your mail server, if you have a pop3 email address(e.g. aol) your smt is probably something like smtp.aol.com, you can find this at your providers name, if you have hotmail.. this is not possible easely, there is way to, but i donīt really know how...
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed Nov 27, 2002 10:58 pm    Post subject: Reply with quote

As said !Keys, your script is OK. But the error you get is caused because you haven't set up your SMTP server in Php.ini . You should open your PHP.ini file and locate the SMTP= line . Fill it with the name of your SMTP server.
It is easy to know its name, open your Mail reader (outlook for example) and in the options locate the SMTP server you use and copy/paste its value there. Save your php.ini file and close it.
Now your script will work fine.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Thu Nov 28, 2002 2:53 pm    Post subject: Reply with quote

aprelium wrote:
As said !Keys, your script is OK. But the error you get is caused because you haven't set up your SMTP server in Php.ini . You should open your PHP.ini file and locate the SMTP= line . Fill it with the name of your SMTP server.
It is easy to know its name, open your Mail reader (outlook for example) and in the options locate the SMTP server you use and copy/paste its value there. Save your php.ini file and close it.
Now your script will work fine.


i just told him the same :roll:
:lol:
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Nov 29, 2002 1:22 am    Post subject: Reply with quote

!Keys wrote:
i just told him the same :roll:
:lol:

Oops, we haven't seen your post :wink:
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Fri Nov 29, 2002 2:47 pm    Post subject: Reply with quote

lol

btw, who is/are "we"?
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Nov 29, 2002 11:27 pm    Post subject: Reply with quote

!Keys wrote:
lol

btw, who is/are "we"?

"We" represents the people at aprelium that are in charge of technical support :D
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Sat Nov 30, 2002 12:16 am    Post subject: Reply with quote

I thought that lol :P..with how many are you if i may ask :-)
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Nov 30, 2002 1:32 am    Post subject: Reply with quote

!Keys wrote:
I thought that lol :P..with how many are you if i may ask :-)

Why not keeping that information a mystery ? :wink:
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Sat Nov 30, 2002 11:23 am    Post subject: Reply with quote

:roll:
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
mkshannon
-


Joined: 13 Nov 2002
Posts: 7

PostPosted: Sat Dec 07, 2002 4:45 pm    Post subject: Reply with quote

Well I have been computerless for just over a week, but finally got it fixed. Just reinstalled all my php and OMG my email form worked perfectly.

Thanks so much !keys and aprelium.
:D
Back to top View user's profile Send private message
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Sat Dec 07, 2002 11:20 pm    Post subject: Reply with quote

No problem. thatīs why we are here :D
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
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