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 = "[email protected]"; $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 Link to comment https://forums.phpfreaks.com/topic/94072-contact-form-help/ 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 Link to comment https://forums.phpfreaks.com/topic/94072-contact-form-help/#findComment-481900 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. Link to comment https://forums.phpfreaks.com/topic/94072-contact-form-help/#findComment-481903 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 Link to comment https://forums.phpfreaks.com/topic/94072-contact-form-help/#findComment-481908 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.