Html/php email page/form -
i want use php , html create contact page users can send me message directly website email-account
the problem have that, doesn't send messages email-inbox(no errors on page)
here code:
html(no css style): index.html
<!doctype html > <html> <head> <title>contact us</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> <div id="page-wrap"> <div id="contact-area"> send message: <form method="post" action="contactengine.php"> <label for="name">name:</label> <input type="text" name="name" id="name" /> <label for="city">city:</label> <input type="text" name="city" id="city" /> <label for="email">email:</label> <input type="text" name="email" id="email" /> <label for="message">message:</label><br /> <textarea name="message" rows="20" cols="20" id="message"></textarea> <input type="submit" name="submit" value="submit" class="submit-button" /> </form> </div> </div> </body> </html> php: contactengine.php
<?php $emailfrom = "jhondoe@domain.com";<-- not sure 1 $emailto = "myemail@domain.com"; $subject = "website message"; $name = trim(stripslashes($_post['name'])); $tel = trim(stripslashes($_post['tel'])); $email = trim(stripslashes($_post['email'])); $message = trim(stripslashes($_post['message'])); // validation $validationok=true; if (!$validationok) { print "<meta http-equiv=\"refresh\" content=\"0;url=error.htm\">"; exit; } // prepare email body text $body = ""; $body .= "name: "; $body .= $name; $body .= "\n"; $body .= "tel: "; $body .= $tel; $body .= "\n"; $body .= "email: "; $body .= $email; $body .= "\n"; $body .= "message: "; $body .= $message; $body .= "\n"; // send email $success = mail($emailto, $subject, $body, "from: <$emailfrom>"); ?>
Comments
Post a Comment