tecmeister Posted March 2, 2008 Share Posted March 2, 2008 Im having some trouble with the contact form that i have created. This is the code that i have used on the first page: <form method="POST" action="sendeail.php"> Contact Name:<input type="text" name="name" size="30"><br> <br> Contact Company:<input type="text" name="company" size="30"> <br> <br> Contact Email:<input type="text" name="email" size="30"><br> <br> Message<br> <textarea rows="9" name="message" cols="50"></textarea> <br> <br> <input type="submit" value="Send Email" name="Submit"> </form> Second page ?> <!-- Reminder: Add the link for the 'next page' (at the bottom) --> <!-- Reminder: Change 'YourEmail' to Your real email --> <?php if(isset($_POST['submit'])) { $to = "support@nurevolution.co.uk"; $subject = "Form Tutorial"; $name_field = $_POST['name']; $email_field = $_POST['email']; $company_field = $_POST['company']; $message = $_POST['message']; $body = "From: $name_field\n E-Mail: $company_field\n Company; $email_field\n Message:\n $message"; echo "Data has been submitted to $to!"; mail($to, $subject, $body); } ?> Thanks for the help tecmeister Quote Link to comment Share on other sites More sharing options...
shocker-z Posted March 2, 2008 Share Posted March 2, 2008 What happens or doesnt happen? Does the email not send or different error?? Regards Liam Quote Link to comment Share on other sites More sharing options...
tecmeister Posted March 2, 2008 Author Share Posted March 2, 2008 o yeah sorry for not putting that im half asleep. Yes is doesn't send the email. Quote Link to comment Share on other sites More sharing options...
shocker-z Posted March 2, 2008 Share Posted March 2, 2008 I use a class for sending my emails php mailer see link below http://phpmailer.codeworxtech.com/ It's a really good class and allow attachments and everything. As long as your getting your "Data has been submitted to $to!" message the it's down to mail() with the issue. Regards Liam BTW I know that feeling... I have a 6 month old girl lol Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.