Page 1 of 1

mail() not working in Internet Explorer 7

Posted: Tue Feb 15, 2011 5:36 pm
by catbrighton
Hi all,

First off, I have never used php before and I am building my first website so please be kind on my code :D

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" );

?>

Re: mail() not working in Internet Explorer 7

Posted: Tue Feb 15, 2011 6:32 pm
by social_experiment

Code: Select all

<button><a href="send_form_email.php">Email Form</a></button>
Odd that it works in some browsers, but try this instead

Code: Select all

<input type="submit" name="submitButton" value="Email Form" />
Hth