wood1e
asked on
USing a standard email form PHP
Hi I have just tried an email form tutorial, and I get these errors
I am running advanced SMTP server as well as Apavhe 2
Notice: Undefined index: email in C:\Program Files\Apache Group\Apache2\htdocs\sendm ail.php on line 2
Notice: Undefined index: message in C:\Program Files\Apache Group\Apache2\htdocs\sendm ail.php on line 3
Warning: mail(): SMTP server response: 550 Invalid recipient: info@synaxisolutions.co.uk in C:\Program Files\Apache Group\Apache2\htdocs\sendm ail.php on line 6
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\sendm ail.php:2) in C:\Program Files\Apache Group\Apache2\htdocs\sendm ail.php on line 7
Can obviously add code for email form...
I am running advanced SMTP server as well as Apavhe 2
Notice: Undefined index: email in C:\Program Files\Apache Group\Apache2\htdocs\sendm
Notice: Undefined index: message in C:\Program Files\Apache Group\Apache2\htdocs\sendm
Warning: mail(): SMTP server response: 550 Invalid recipient: info@synaxisolutions.co.uk
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\sendm
Can obviously add code for email form...
post the code
"Warning: mail(): SMTP server response: 550 Invalid recipient: info@synaxisolutions.co.uk in C:\Program Files\Apache Group\Apache2\htdocs\sendm ail.php on line 6"
Something is wrong with your SMTP server. I am not sure what SMTP software you are using. You could also change the SMTP server in the php.ini file. Note that you will need to restart apache after modifing the php.ini file.
Something is wrong with your SMTP server. I am not sure what SMTP software you are using. You could also change the SMTP server in the php.ini file. Note that you will need to restart apache after modifing the php.ini file.
ASKER
The HTML is
<form id="myform">
<fieldset>
<legend>Contact form</legend>
<label for="enquiryname"><span>Na me: <strong class="red_text">*</strong ></span></ label>
<input type="text" name="enquiryname" id="enquiryname" value="" size="32" /><br />
<label for="enquiryemail"><span>E mail Address: <strong class="red_text">*</strong ></span></ label>
<input type="text" name="enquiryemail" id="enquiryemail" value="" size="32" /><br />
<label for="enquirytelephone"><sp an>Telepho ne:</span> </label>
<input type="text" name="enquirytelephone" id="enquirytelephone" value="" size="32" /><br />
<label for="enquiryaddress1"><spa n><strong> Address Line 1:</strong> <strong class="red_text">*</strong ></span></ label>
<input type="text" name="enquiryaddress1" id="enquiryaddress1" size="32" value="" /><br />
<label for="enquiryaddress2"><spa n>Address Line 2:</span></label>
<input type="text" name="enquiryaddress2" id="enquiryaddress2" size="32" /><br />
<label for="enquirytown"><span>To wn: <strong class="red_text">*</strong ></span></ label>
<input type="text" name="enquirytown" id="enquirytown" size="32" /><br />
<label for="enquirypostcode"><spa n>Postcode : <strong class="red_text">*</strong ></span></ label>
<input type="text" name="enquirypostcode" id="enquirypostcode" value="" size="8" /><br />
<label for="enquirycomments" class="textarea"><span>Com ments or questions <strong class="red_text">*</strong ></span></ label>
<textarea name="enquirycomments" id="enquirycomments" cols="50" rows="10"></textarea><br />
<label for="enquirynewsletter" class="right"><span><input type="checkbox" name="enquirynewsletter" id="enquirynewsletter" value="checkbox" /></span></label>
<div class="comment">Tick if you wish to receive David Mundell's email newsletters</div></p>
<label style="border:none;"><span ></span></ label>
<input class="button" type="submit" value="Send" name="submit" class="submit" />
</fieldset>
</form>
and the PHP is
<?
$email=$_REQUEST['email'];
$message=$_REQUEST['messag e'];
mail("info@synaxisolutions .co.uk", "Feedback form results",
$message, "Form:$email");
header ("Location: http://www.example.com/thankyou.htm");
?>
I am sure I found it on this website, but with me playing around with it I think I have really buggered it up!!!.....Thats a technical term :)
I am using Advanced SMTP...
<form id="myform">
<fieldset>
<legend>Contact form</legend>
<label for="enquiryname"><span>Na
<input type="text" name="enquiryname" id="enquiryname" value="" size="32" /><br />
<label for="enquiryemail"><span>E
<input type="text" name="enquiryemail" id="enquiryemail" value="" size="32" /><br />
<label for="enquirytelephone"><sp
<input type="text" name="enquirytelephone" id="enquirytelephone" value="" size="32" /><br />
<label for="enquiryaddress1"><spa
<input type="text" name="enquiryaddress1" id="enquiryaddress1" size="32" value="" /><br />
<label for="enquiryaddress2"><spa
<input type="text" name="enquiryaddress2" id="enquiryaddress2" size="32" /><br />
<label for="enquirytown"><span>To
<input type="text" name="enquirytown" id="enquirytown" size="32" /><br />
<label for="enquirypostcode"><spa
<input type="text" name="enquirypostcode" id="enquirypostcode" value="" size="8" /><br />
<label for="enquirycomments" class="textarea"><span>Com
<textarea name="enquirycomments" id="enquirycomments" cols="50" rows="10"></textarea><br />
<label for="enquirynewsletter" class="right"><span><input
<div class="comment">Tick if you wish to receive David Mundell's email newsletters</div></p>
<label style="border:none;"><span
<input class="button" type="submit" value="Send" name="submit" class="submit" />
</fieldset>
</form>
and the PHP is
<?
$email=$_REQUEST['email'];
$message=$_REQUEST['messag
mail("info@synaxisolutions
$message, "Form:$email");
header ("Location: http://www.example.com/thankyou.htm");
?>
I am sure I found it on this website, but with me playing around with it I think I have really buggered it up!!!.....Thats a technical term :)
I am using Advanced SMTP...
ASKER
ANd this is from my PHP.ini file...
[mail function]
; For Win32 only.
SMTP = localhost ; for Win32 only
smtp_port = 25
sendmail_from= info@synaxissolutions.co.u k ; for Win32 only
; For Win32 only.
;sendmail_from = info@syanxissolutions.co.u k
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
[mail function]
; For Win32 only.
SMTP = localhost ; for Win32 only
smtp_port = 25
sendmail_from= info@synaxissolutions.co.u
; For Win32 only.
;sendmail_from = info@syanxissolutions.co.u
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
I take it you have a Windows Server. Using what SMTP server? Sounds like relaying isn't properly setup to me.
ASKER
I am using, Apache, and Advanced SMTP on win2k pro machine
You might need to set up your 'trusted senders' in the Advanced SMTP program.
JP
JP
ASKER
HI, I donp;t appear to need as I tested Port 25 and it worked?
ASKER
HI,
I have changed the scrips I am using..and I have found a simple email form using PHP...
The HTML is :
Send us an comment about our site!<br />
<form action="mail.php" method="post">
Subject for email : <input type="text" name="subject"><br />
Visitor email : <input type="text" name="from"><br />
Message : <textarea name="message" rows="3" cols="40"></textarea><br />
<input type="submit" value="Send the info">
<input type="reset" value="Clear the form">
</form>
Saved in my htdocs folder
ANd the PHP is:
<?php
$to = "info@synaxissolutions.co. uk";
$headers = "From: " . $from . "\r\n";
$headers .= "Reply-To: " . $from . "\r\n";
$headers .= "Return-Path: " . $from . "\r\n";
if ( mail($to,$subject,$message ,$headers) ) {
echo "The email has been sent!";
} else {
echo "The email has failed!";
}
?>
Also saved in my htdocs folder...
When I click send/submit button I get a window saying do I want to downlaod or save...
WHat is wrong? please help...:)
I have changed the scrips I am using..and I have found a simple email form using PHP...
The HTML is :
Send us an comment about our site!<br />
<form action="mail.php" method="post">
Subject for email : <input type="text" name="subject"><br />
Visitor email : <input type="text" name="from"><br />
Message : <textarea name="message" rows="3" cols="40"></textarea><br />
<input type="submit" value="Send the info">
<input type="reset" value="Clear the form">
</form>
Saved in my htdocs folder
ANd the PHP is:
<?php
$to = "info@synaxissolutions.co.
$headers = "From: " . $from . "\r\n";
$headers .= "Reply-To: " . $from . "\r\n";
$headers .= "Return-Path: " . $from . "\r\n";
if ( mail($to,$subject,$message
echo "The email has been sent!";
} else {
echo "The email has failed!";
}
?>
Also saved in my htdocs folder...
When I click send/submit button I get a window saying do I want to downlaod or save...
WHat is wrong? please help...:)
Sounds like you don't have PHP properly set up any more. What else have you changed?
ASKER
NOthing as far as I know...
WHat else do I need to look at?
WHat else do I need to look at?
ASKER
PS I can post my.ini if required...
Oh and when I usemy browser to view info.php it works..and I have all the php info?
Oh and when I usemy browser to view info.php it works..and I have all the php info?
"do I want to download or save"...
what file type does Windows think you are downloading?
try to use telnet to fetch the file, and send us the headers which your server is sending across.
The command is something like
telnet www.yourserver.com 80
The you have to hand-type
HTTP/1.0 GET /
It's something like that... you'll have to look it up on the web.
JP
what file type does Windows think you are downloading?
try to use telnet to fetch the file, and send us the headers which your server is sending across.
The command is something like
telnet www.yourserver.com 80
The you have to hand-type
HTTP/1.0 GET /
It's something like that... you'll have to look it up on the web.
JP
>When I click send/submit button I get a window saying do I want to downlaod or save...
This is a mime-type handler problem. PHP isn't properly setup in apache.
Regarding : synaxisolutions.co.uk
root@trisha [/usr/local/lib]# dig synaxisolutions.co.uk
; <<>> DiG 9.2.4 <<>> synaxisolutions.co.uk
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 11309
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
root@trisha [/usr/local/lib]# dig mx synaxisolutions.co.uk
; <<>> DiG 9.2.4 <<>> mx synaxisolutions.co.uk
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 46994
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
Could you get getting a 550 because it can't find the domain? Looks like your dns is not properly setup.
More than likely though, your email server has given you a 550 since relaying is denied. Properly setup you email server, and this won't occur.
This is a mime-type handler problem. PHP isn't properly setup in apache.
Regarding : synaxisolutions.co.uk
root@trisha [/usr/local/lib]# dig synaxisolutions.co.uk
; <<>> DiG 9.2.4 <<>> synaxisolutions.co.uk
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 11309
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
root@trisha [/usr/local/lib]# dig mx synaxisolutions.co.uk
; <<>> DiG 9.2.4 <<>> mx synaxisolutions.co.uk
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 46994
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
Could you get getting a 550 because it can't find the domain? Looks like your dns is not properly setup.
More than likely though, your email server has given you a 550 since relaying is denied. Properly setup you email server, and this won't occur.
Please attempt immediately to email 'mcollard@hotmail.com' and see if it gives you the error. I think the DNS MX entry is giving you the trouble.
PS: If I fix the problem, I want points from all the questions. =) J/K
PS: If I fix the problem, I want points from all the questions. =) J/K
According to my research this 550 Invalid recipient could happen if the domain MX, but not the user was found. But because I can't find your MX, I assume your SMTP can't either. =)
ASKER
Hi Promethyl,
Do you mean set up a send email form with your address as the receiving address?
Do you mean set up a send email form with your address as the receiving address?
Just about any address besides synax*.com. I want to see if that's the problem. Any problem which we can narrow down as NOT RELATED is one more step which brings you to your successful conclusion.
ASKER
oh right, ok I have created anew form and email .php from another tutorial and they seem to work...I have posted the .php file and .htm file, below....
Can't see why this should work!!!!????!!!!
Even more confused now :)
mail.htm
<html>
<head><title>fgf</title>
</head>
<body>
<form action="mail.php" method="post">
Your Name: <input type="text" name="name"><br>
E-mail: <input type="text" name = "email"><br><br>
Comments<br>
<textarea name="comments"></textarea ><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
mail.php
<?
$name=$_POST['name'];
$email=$_POST['email'];
$comments=$_POST['comments '];
$to="info@synaxissolutions .co.uk";
$message="$name just filled in your comments form. They said:\n$comments\n\nTheir e-mail address was: $email";
if(mail($to,"Comments From Your Site",$message,"From: $email\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>
both these fiels are saved to the htdocs folder
PS you can have as many points as I can offer if you can explain what the hell is going on...why the above works?
Can't see why this should work!!!!????!!!!
Even more confused now :)
mail.htm
<html>
<head><title>fgf</title>
</head>
<body>
<form action="mail.php" method="post">
Your Name: <input type="text" name="name"><br>
E-mail: <input type="text" name = "email"><br><br>
Comments<br>
<textarea name="comments"></textarea
<input type="submit" value="Submit">
</form>
</body>
</html>
mail.php
<?
$name=$_POST['name'];
$email=$_POST['email'];
$comments=$_POST['comments
$to="info@synaxissolutions
$message="$name just filled in your comments form. They said:\n$comments\n\nTheir e-mail address was: $email";
if(mail($to,"Comments From Your Site",$message,"From: $email\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>
both these fiels are saved to the htdocs folder
PS you can have as many points as I can offer if you can explain what the hell is going on...why the above works?
Well, you dropped the headers for one. Remove the headers in the first program and see if it works...
Perhaps a spam blocker nailing you because it doesn't like one of the header fields?
Perhaps a spam blocker nailing you because it doesn't like one of the header fields?
ASKER
I will look at it again tomorrow..and try a more sophisticated form email...and see what happens...then if the more sophisticated one works i will award points, many thanks for sticking around...tired now so off to bed..
Something I did notice...if I open up htdocs folder, and double clicked on the .htm file, and then filled out fetails adn clicked send...a window would show asking whether I wanted to save or download...
BUt if I typed into my browser localhost/mail.htm no problem at all....filled out detais sent form, and got it in my Outlook!! Very strange indeed...but something else learnt...which has to be good...
Once again many thanks...
Something I did notice...if I open up htdocs folder, and double clicked on the .htm file, and then filled out fetails adn clicked send...a window would show asking whether I wanted to save or download...
BUt if I typed into my browser localhost/mail.htm no problem at all....filled out detais sent form, and got it in my Outlook!! Very strange indeed...but something else learnt...which has to be good...
Once again many thanks...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi, Sorry for the delay, I have been busy living!!! :)
ANyway I found a form from formtoemail.com which I have just tested, and it works as well as an even simplier form mail I tried the other day..
Now just need to woork at it, so I can get rid of their link, and hide the receinving email address...
Many thanks for your help...
Rob (wood1e)
ANyway I found a form from formtoemail.com which I have just tested, and it works as well as an even simplier form mail I tried the other day..
Now just need to woork at it, so I can get rid of their link, and hide the receinving email address...
Many thanks for your help...
Rob (wood1e)