
Simple PHP Sending E-mails
Hi
I'm trying to send a simple email directly from an online form, using a simple php script. (see below)
It works on my machine ("localhost", (using xampp), and the email is sent from the form to my email address, hosted with another hosting company), but when I upload the page to the host here the email won't send (its acting as if it's sent it, but the mail never arrives, eg: the form displays > fill in the form > click 'send' > page is processed > confirmation message is displayed > no email ever arrives )
any ideas as to why the email can't be sent from limeWebs / gotoNames host?
Code:
//the script below is not my own creation - its from the W3C (http://w3schools.com)
<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
//the below email address is correct on my script - below is a dummy address
mail("me@my_email_address.com", "$subject",
$message, "From:" . $email);
echo "Thank you for using our mail form";
}
else
//if "email" is not filled out, display the form
{
echo "<form method='post' action='mailform.php'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?>