Page 1 of 1

mail contact form doesn;t send any emails

Posted: Thu Sep 01, 2005 1:52 pm
by brand_beatrice
Hi everybody
I have uploaded a simple formmail.php on my site.

Code: Select all

<?php

// your email address
$youremail = "admin@bicestertown.co.uk";

// field validation
if ($email=="" || $comments=="" || $name=="")

{
print ("All fields are required! Please go back and try again.");
}

else {

// email validation
if(!eregi('^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3})?)$', $email)) {
print ("Your email address does not appear to be valid. Please go back and try again.");
exit;
}

// send email
$headers = "From: \"$name\" <$email>\n";
$subject = "Feedback Form"; 
$message = "$comments";

mail ("$youremail", "$subject", $message, $headers);
print ("Thank you $name, your email has been sent to Bicester Town.");

} 
?>
I have a 2 contact forms in 2 of my pages:

1) http://www.bicestertown.co.uk/2-INDEX/contact.htm
2) http://www.bicestertown.co.uk/advertise ... scribe.htm

Both forms use the same php file (formmail.php)

The problem here is that form number 1) doesn't send emails. I get the confirmation page but it doesn’t send any emails. Also, it opens the confirmation page in its own window. (a new window) The code is the same as I am using the same code for both. Why one of them sends emails and the other one doesn’t?


feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Thu Sep 01, 2005 4:18 pm
by brand_beatrice
yes, you are right.
here they are:(the codes)

1)working one
---------------------------------------------------------------------

Code: Select all

<TABLE id=table1 
style="BORDER-COLLAPSE: collapse" 
borderColor=#111111 cellSpacing=0 cellPadding=0 
width="100%" border=0><TR><TD width="86%">
<form action="formmail.php" method="post"><input type="text" name="name"><font color="#666666" face="Verdana" style="font-size: 8pt; font-weight: 700">Name</font><br><input type="text" name="email"><font color="#666666" face="Verdana" style="font-size: 8pt; font-weight: 700">E-mail<br><br>Your Suggestion/Opinion</font><br>
<textarea name="comments" style="width: 325; height: 83" cols="50" rows="10"></textarea><br><INPUT type=submit value=Submit name=submit style="width: 50; height: 20"></form></TR></TABLE>
------------------------------------------------------------------------

2) not working one:
----------------------------------------------------------------

Code: Select all

<TABLE id=table1 
style="BORDER-COLLAPSE: collapse" 
borderColor=#111111 cellSpacing=0 cellPadding=0 
width="99%" border=0><TR><TD width="99%">
<form action="formmail.php" method="post"><input type="text" name="name"><font color="#666666" face="Verdana" style="font-size: 8pt; font-weight: 700">Name</font><br><input type="text" name="email"><font color="#666666" face="Verdana" style="font-size: 8pt; font-weight: 700">E-mail<br><br>Your Suggestion/Opinion</font><br>
<textarea name="comments" style="width: 325; height: 83" cols="50" rows="10"></textarea><br><INPUT type=submit value=Submit name=submit style="width: 50; height: 20"></form></TR></TABLE>
---------------------------------------------------------------

Thank you.
p.s.
i still believe that issue has something related to the fact the the not working one opens a new page after i click submit button.

Posted: Fri Sep 02, 2005 4:45 pm
by brand_beatrice
i do not see any differences at all....what the hell is wrong?