mail() not working in Internet Explorer 7

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
catbrighton
Forum Newbie
Posts: 1
Joined: Tue Feb 15, 2011 5:03 pm

mail() not working in Internet Explorer 7

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

?>
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: mail() not working in Internet Explorer 7

Post 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
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply