Hello all, I am new here and a novice at scripting.
Here is the problem:
I am on a free host which does not allow smtp but does allow php. I have a form on my site and a php file to redirect the form content to my email. private@hotmail.com is just there to denote my address privacy on the forum. All I did was made a new html doc, pasted the php contents below to it and named it email.php Then uploaded it to where my pages are (same folder as all the pages and the contact.html). Next I think I may have fudged the <form action, method, src line up...not sure. (Question resumes after scripts) Please help!
The email.php form:
<?php
//copy this line for each <input name="__"
$name = $POST["name"];
$theiremail = $POST["theiremail"];
$email = "Sender Name:\t$name\n
Sender E-Mail:\t$theiremail\n
Message:\t$message\n";
$to = "private@hotmail.com";
$subject = "Site Message from ".$name;
$mailheaders = "From: $thereemail <> \n";
$mailheaders .= "Reply-To: $thereemail\n\n";
if(mail($to, $subject, $email, $mailheaders)){
echo "Your message has been sent! I will respond as soon as possible.
Thanks, and have a great day!";
} else {
echo "There has been an error sending the message. Please send your
message using email to private@hotmail.com . Sorry 🙁";
}
php?>
And the contact.html page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Talyn Group</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div id="main">
<div id="top"></div>
<div id="wrap">
<div id="left">
<h1><span class="darker">Talyn</span>GROUP</h1>
<div id="tagline">Connect with customers</div>
<div id="nav">
<ul>
<li><a href="index.html">home</a></li>
<li><a href="portfolio.html">portfolio</a></li>
<li><a href="about.html">about</a></li>
<li><a href="contact.html">contact</a></li>
</ul>
</div>
<p class="headline"><a href="about.html"></a></p>
</div>
<div id="main_img">
<div id="content_main">
<!-- item -->
<div class="item">
<h2>Contact</h2>
<p>Provide us with a brief description of your project.</p>
<p>required</p>
</div>
<!-- item -->
<!-- form -->
<div class="form">
<form id="comments_form" action="email.php" method="post" src="email.php">
<fieldset>
<legend>Your Contact Details</legend>
<p>
<label for="author">Name: <em class="required"></em></label>
<input name="author" id="author" type="text" />
</p>
<p>
<label for="email">Email Address:</label>
<input name="email" id="email" type="text" />
</p>
<p>
<label for="url">Web Address:</label>
<input name="url" id="url" type="text" />
</p>
</fieldset>
<fieldset>
<legend>Comments</legend>
<p>
<label for="text">Message: <em class="required">*</em></label>
<textarea name="text" id="text" cols="20" rows="10"></textarea>
</p>
</fieldset>
<p class="form_center"><input id="submit" class="submit" name="submit" type="submit"/></p>
</form>
</div>
<!-- form -->
</div>
</div>
</div>
<div id="bottom"></div>
<div id="footer">
<p>© 2007 | <a href="http://private@gmail.com" target="_blank">Talyn Group</a></p>
</div>
</div>
</body>
</html>
Ok when I try to send the form, it says it works (I get the Your message has been sent, not the error) but, I dont receive anything in box...
Would appreciate some feedback on this as I really dont want to use the mailto: function.
Thanks all for your time,
MW