View previous topic :: View next topic |
Author |
Message |
mkshannon -
Joined: 13 Nov 2002 Posts: 7
|
Posted: Wed Nov 27, 2002 4:47 pm Post subject: problems with an email form |
|
|
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 |
|
|
!Keys -
Joined: 23 Nov 2002 Posts: 156 Location: Holland, Enschede
|
Posted: Wed Nov 27, 2002 9:48 pm Post subject: |
|
|
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 |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Wed Nov 27, 2002 10:58 pm Post subject: |
|
|
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 |
|
|
!Keys -
Joined: 23 Nov 2002 Posts: 156 Location: Holland, Enschede
|
Posted: Thu Nov 28, 2002 2:53 pm Post subject: |
|
|
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 |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Nov 29, 2002 1:22 am Post subject: |
|
|
!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 |
|
|
!Keys -
Joined: 23 Nov 2002 Posts: 156 Location: Holland, Enschede
|
Posted: Fri Nov 29, 2002 2:47 pm Post subject: |
|
|
lol
btw, who is/are "we"? _________________ !Keys || MwM^computerware |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Nov 29, 2002 11:27 pm Post subject: |
|
|
!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 |
|
|
!Keys -
Joined: 23 Nov 2002 Posts: 156 Location: Holland, Enschede
|
Posted: Sat Nov 30, 2002 12:16 am Post subject: |
|
|
I thought that lol :P..with how many are you if i may ask :-) _________________ !Keys || MwM^computerware |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat Nov 30, 2002 1:32 am Post subject: |
|
|
!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 |
|
|
!Keys -
Joined: 23 Nov 2002 Posts: 156 Location: Holland, Enschede
|
Posted: Sat Nov 30, 2002 11:23 am Post subject: |
|
|
:roll: _________________ !Keys || MwM^computerware |
|
Back to top |
|
|
mkshannon -
Joined: 13 Nov 2002 Posts: 7
|
Posted: Sat Dec 07, 2002 4:45 pm Post subject: |
|
|
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 |
|
|
!Keys -
Joined: 23 Nov 2002 Posts: 156 Location: Holland, Enschede
|
Posted: Sat Dec 07, 2002 11:20 pm Post subject: |
|
|
No problem. that´s why we are here :D _________________ !Keys || MwM^computerware |
|
Back to top |
|
|
|