mail() not working in Internet Explorer 7
Posted: Tue Feb 15, 2011 5:36 pm
Hi all,
First off, I have never used php before and I am building my first website so please be kind on my code
I have designed a simple contact form for the site and it seems to work ok on firefox and some internet explorers but IE7 the button doesn't do anything. It doesn't give an error either! Can someone help?
HTML:
<form name="contactform" method="post" action="send_form_email.php">
Name:<br /> <input type="text" name="name"/><br />
Organisation:<br /> <input type="text" name="organisation"/><br />
E-mail:<br /> <input type="text" name="email"/><br />
Telephone number:<br /> <input type="text" name="telephone"/><br />
Preferred method of contact:<br />
<select name="mydropdown">
<option value="Email">Email</option>
<option value="Telephone">Telephone</option>
<option value="Post">Post</option>
</select>
<br/>
Comment: <br /> <TEXTAREA NAME="comments" COLS=400 ROWS=6></TEXTAREA><br />
<br />
<button><a href="send_form_email.php">Email Form</a></button>
</form>
PHP:
<?php
ini_set("display_errors", "1");
error_reporting(E_ALL);
$name = $_REQUEST['name'] ;
$organisation = $_REQUEST['organisation'] ;
$email = $_REQUEST['email'] ;
$telephone = $_REQUEST['telephone'] ;
$mydropdown = $_REQUEST['mydropdown'] ;
$message = "NAME: $name \n
ORGANISATION: $organisation \n
TELEPHONE: $telephone
PREFERRED METHOD OF CONTACT: $mydropdown
" ;
mail("me@myemail.co.uk", "-----------Website contact-----------",
$message, "From: $email" );
header( "Location: http://www.mywebsite.co.uk/thankyou.html" );
?>
First off, I have never used php before and I am building my first website so please be kind on my code
I have designed a simple contact form for the site and it seems to work ok on firefox and some internet explorers but IE7 the button doesn't do anything. It doesn't give an error either! Can someone help?
HTML:
<form name="contactform" method="post" action="send_form_email.php">
Name:<br /> <input type="text" name="name"/><br />
Organisation:<br /> <input type="text" name="organisation"/><br />
E-mail:<br /> <input type="text" name="email"/><br />
Telephone number:<br /> <input type="text" name="telephone"/><br />
Preferred method of contact:<br />
<select name="mydropdown">
<option value="Email">Email</option>
<option value="Telephone">Telephone</option>
<option value="Post">Post</option>
</select>
<br/>
Comment: <br /> <TEXTAREA NAME="comments" COLS=400 ROWS=6></TEXTAREA><br />
<br />
<button><a href="send_form_email.php">Email Form</a></button>
</form>
PHP:
<?php
ini_set("display_errors", "1");
error_reporting(E_ALL);
$name = $_REQUEST['name'] ;
$organisation = $_REQUEST['organisation'] ;
$email = $_REQUEST['email'] ;
$telephone = $_REQUEST['telephone'] ;
$mydropdown = $_REQUEST['mydropdown'] ;
$message = "NAME: $name \n
ORGANISATION: $organisation \n
TELEPHONE: $telephone
PREFERRED METHOD OF CONTACT: $mydropdown
" ;
mail("me@myemail.co.uk", "-----------Website contact-----------",
$message, "From: $email" );
header( "Location: http://www.mywebsite.co.uk/thankyou.html" );
?>