{"id":247,"date":"2019-05-08T20:29:21","date_gmt":"2019-05-08T20:29:21","guid":{"rendered":"https:\/\/avantutor.com\/blog\/?p=247"},"modified":"2019-05-08T20:33:14","modified_gmt":"2019-05-08T20:33:14","slug":"contact-us-form-html-template-to-work","status":"publish","type":"post","link":"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/","title":{"rendered":"How I Got a Contact Us Form Inside a HTML Template to Work"},"content":{"rendered":"\n<p>So you downloaded an amazing <strong>website template<\/strong> that you just can&#8217;t wait to work with.  You were able to <strong>customize<\/strong> the whole template except for the <strong>contact form <\/strong>part.  You realize that it takes some <strong>backend work<\/strong> in order for it to function.  The problem is you are not a backend person.  You just need some clear instructions on how to get the contact form data to be emailed to yourself.  Well, here it is &#8211; assuming you have hosting with <strong>cPanel<\/strong> and an email associated with your domain through your host provider. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The HTML Form<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;form method=\"post\" action=\"php\/contact_us_action.php\">\n              &lt;div class=\"form-group row\">\n                &lt;div class=\"col-md-6 mb-4\">\n                  &lt;input type=\"text\" class=\"form-control\" placeholder=\"First name\" name=\"first_name\">\n                &lt;\/div>\n                &lt;div class=\"col-md-6\">\n                  &lt;input type=\"text\" class=\"form-control\" placeholder=\"Last name\" name=\"last_name\">\n                &lt;\/div>\n              &lt;\/div>\n\n              &lt;div class=\"form-group row\">\n                &lt;div class=\"col-md-12\">\n                  &lt;input type=\"text\" class=\"form-control\" placeholder=\"Subject\" name=\"subject\">\n                &lt;\/div>\n              &lt;\/div>\n\n              &lt;div class=\"form-group row\">\n                &lt;div class=\"col-md-12\">\n                  &lt;input type=\"email\" class=\"form-control\" placeholder=\"Email\" name=\"email\">\n                &lt;\/div>\n              &lt;\/div>\n              &lt;div class=\"form-group row\">\n                &lt;div class=\"col-md-12\">\n                  &lt;textarea class=\"form-control\" id=\"\" cols=\"30\" rows=\"10\" placeholder=\"Write your message here.\" name=\"message\">&lt;\/textarea>\n                &lt;\/div>\n              &lt;\/div>\n\n              &lt;div class=\"form-group row\">\n                &lt;div class=\"col-md-6\">\n\n                  &lt;input type=\"submit\" class=\"btn btn-primary py-3 px-5 btn-block\" value=\"Send Message\">\n                &lt;\/div>\n              &lt;\/div>\n\n            &lt;\/form><\/code><\/pre>\n\n\n\n<p>What is important here is the <strong>name attribute<\/strong> for each form element.  Your form will probably look different and have different fields but you definitely need to add a name attribute to each form element.  Additionally, pay special attention to the following line: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;form method=\"post\" action=\"php\/contact_us_action.php\"><\/code><\/pre>\n\n\n\n<p><strong>action attribute<\/strong> specifies where to handle the email submission logic.  In this case I created a &#8216;<strong>php&#8217; folder<\/strong> and then created a <strong>contact_us_action.php<\/strong> file.  This is where the main form submission takes place. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The contact_us_action.php File<\/h2>\n\n\n\n<p>Once the user submits the form we go to <strong>contact_us_action.php.<\/strong>  Please create this file (inside the newly created php folder) and add the following code to it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/\/ [ATTENTION] Change this if you want to check for a different field \n\/\/ Program doesn't continue if email field is missing\nif(isset($_POST['email'])) {\n    \/\/ EDIT THE 2 LINES BELOW AS REQUIRED\n    $email_to = \"CHANGE_TO_YOUR_PERSONAL_EMAIL_ADDRESS;\n\n    function died($error) {\n        \/\/ your error code can go here\n        echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n        echo \"These errors appear below.&lt;br \/>&lt;br \/>\";\n        echo $error.\"&lt;br \/>&lt;br \/>\";\n        echo \"Please go back and fix these errors.&lt;br \/>&lt;br \/>\";\n        die();\n    }\n    \/\/ validation expected data exists\n    \/\/ [ATTENTION] This part makes sure that 'first_name', 'message' and \n    \/\/ 'email' fields were submitted. Add more or remove some.  \n    if(!isset($_POST['first_name']) ||\n        !isset($_POST['message']) ||\n        !isset($_POST['email'])) {\n        died('We are sorry, but there appears to be a problem with the form you submitted.');\n    }\n\n    \/\/ [ATTENTION] Change these fields accordingly. \n    \/\/ Change the value for $email_from_default\n    $first_name = $_POST['first_name'];\n    $last_name = $_POST['last_name'];\n    $subject = $_POST['subject'];\n    $message = $_POST['message'];\n    $email_from = $_POST['email'];\n    $email_subject = \"CHANGE_TO_YOUR_SUBJECT\";\n    $email_from_default = \"CHANGE_TO_YOUR_HOST_DOMAIN_EMAIL\";\n\n    $error_message = \"\";\n    $email_exp = '\/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$\/';\n\n  if(!preg_match($email_exp,$email_from)) {\n    $error_message .= 'The Email Address you entered does not appear to be valid.&lt;br \/>';\n  }\n\n    $string_exp = \"\/^[A-Za-z .'-]+$\/\";\n\n  if(!preg_match($string_exp,$first_name)) {\n    $error_message .= 'The First Name you entered does not appear to be valid.&lt;br \/>';\n  }\n\n  if(!preg_match($string_exp,$last_name)) {\n    $error_message .= 'The Last Name you entered does not appear to be valid.&lt;br \/>';\n  }\n\n  if(strlen($error_message) > 0) {\n    died($error_message);\n  }\n    $email_message = \"Form details below.\\n\\n\";\n\n    function clean_string($string) {\n      $bad = array(\"content-type\",\"bcc:\",\"to:\",\"cc:\",\"href\");\n      return str_replace($bad,\"\",$string);\n    }\n\n    $email_message .= \"First Name: \".clean_string($first_name).\"\\n\";\n    $email_message .= \"Last Name: \".clean_string($last_name).\"\\n\";\n    $email_message .= \"message: \".clean_string($message).\"\\n\";\n    $email_message .= \"Email: \".clean_string($email_from).\"\\n\";\n\n    \/\/ create email headers\n    $headers = 'From: '.$email_from_default.\"\\r\\n\".\n    'Reply-To: '.$email_from_default.\"\\r\\n\" .\n    'X-Mailer: PHP\/' . phpversion();\n    @mail($email_to, $email_subject, $email_message, $headers);\n?>\n\n&lt;!DOCTYPE html>\n&lt;html lang=\"en\">\n&lt;head>\n  &lt;link rel=\"shortcut icon\" href=\"images\/icon.ico\">\n  &lt;title>CHANGE_TO_YOUR_TITLE&lt;\/title>\n  &lt;meta charset=\"utf-8\">\n  &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n  &lt;meta name=\"description\" content=\"Thank you for contacting us\" \/>\n&lt;\/head>\n&lt;body>\n  &lt;h1>Thank You!&lt;\/h1>\n&lt;\/body>\n&lt;\/html>\n\n&lt;?php\n}\n?>\n<\/code><\/pre>\n\n\n\n<p>In the example above the form has a first_name, last_name, subject, email and a message field. Change it to whatever fields you have. I have added<strong> [ATTENTION]<\/strong> comment to all the places where you have to pay special attention to and might have to do an edit.  Also pay attention to all <strong>CHANGE_&#8230; <\/strong> text.  Feel free to modify the <strong>HTML section<\/strong> at the end.  <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">PHP mail Function and Your Host<\/h2>\n\n\n\n<p>I am using the <strong>PHP mail function<\/strong> to achieve my goal.  There are <strong>other ways!<\/strong>  I believe they require more work but none the less there are other ways.  In order for the mail function to work out of the box I needed to make sure I had an <strong>email account<\/strong> that was created in the <strong>Namecheap cPanel <\/strong>and that was <strong>hosted<\/strong> on their <strong>servers<\/strong>.  <\/p>\n\n\n\n<p>Here is how determined what my default email address with my host was. Login into your cPanel then click on <strong>Email Accounts<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1003\" height=\"720\" src=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts.png\" alt=\"cPanel Email Accounts Step 1\nHow to determine your Namecheap host email address\" class=\"wp-image-249\" srcset=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts.png 1003w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts-300x215.png 300w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts-768x551.png 768w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts-552x396.png 552w\" sizes=\"(max-width: 1003px) 100vw, 1003px\" \/><figcaption>Step 1) cPanel Email Accounts<\/figcaption><\/figure>\n\n\n\n<p>I had an email account already listed. If you don&#8217;t have one just click on create otherwise click on <strong>CHECK EMAIL<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"487\" src=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_2-1024x487.png\" alt=\"cPanel Email Accounts Step 2\nHow to determine your Namecheap host email address\" class=\"wp-image-250\" srcset=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_2-1024x487.png 1024w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_2-300x143.png 300w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_2-768x365.png 768w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_2-1140x543.png 1140w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_2-552x263.png 552w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_2.png 1494w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Step 2) cPanel Email Accounts CHECK EMAIL<\/figcaption><\/figure>\n\n\n\n<p>Click on <strong>horde<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"891\" height=\"702\" src=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_3.png\" alt=\"cPanel Email Accounts Step 3\nHow to determine your Namecheap host email address\" class=\"wp-image-251\" srcset=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_3.png 891w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_3-300x236.png 300w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_3-768x605.png 768w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts_3-552x435.png 552w\" sizes=\"(max-width: 891px) 100vw, 891px\" \/><figcaption>Step 3) cPanel Check Email horde<\/figcaption><\/figure>\n\n\n\n<p> Send an email to personal email address here<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"339\" src=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Screen-Shot-2019-05-08-at-12.52.21-PM.png\" alt=\"cPanel Email Accounts Step 4\nHow to determine your Namecheap host email address\" class=\"wp-image-255\" srcset=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Screen-Shot-2019-05-08-at-12.52.21-PM.png 806w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Screen-Shot-2019-05-08-at-12.52.21-PM-300x126.png 300w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Screen-Shot-2019-05-08-at-12.52.21-PM-768x323.png 768w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Screen-Shot-2019-05-08-at-12.52.21-PM-552x232.png 552w\" sizes=\"(max-width: 806px) 100vw, 806px\" \/><figcaption>Step 4) Compose Email <\/figcaption><\/figure>\n\n\n\n<p>Check your personal email <strong>inbox<\/strong> and copy the <strong>from email address<\/strong>.   That is one way to obtain what the full email address associated with your host is.  I am sure there is an easier way but this is how I did it.  In my case it wasn&#8217;t as simple as username@mydomain.com. <\/p>\n\n\n\n<p>My host Namecheap also suggested I have <strong>Local Mail Exchanger<\/strong> (whatever that is).  Here is how I made sure I do! Click on <strong>Email Routing<\/strong> in cPanel.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1003\" height=\"720\" src=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Routing.png\" alt=\"cPanel Email Routing Step 1\nHow to make sure Local Mail Exchanger is selected\" class=\"wp-image-253\" srcset=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Routing.png 1003w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Routing-300x215.png 300w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Routing-768x551.png 768w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Routing-552x396.png 552w\" sizes=\"(max-width: 1003px) 100vw, 1003px\" \/><figcaption>Step 1) cPanel Email Routing<\/figcaption><\/figure>\n\n\n\n<p>Bamn, that it is.  It was already selected for me. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"841\" height=\"711\" src=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Routing_2.png\" alt=\"cPanel Email Routing Step 2\nHow to make sure Local Mail Exchanger is selected\" class=\"wp-image-254\" srcset=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Routing_2.png 841w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Routing_2-300x254.png 300w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Routing_2-768x649.png 768w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Routing_2-552x467.png 552w\" sizes=\"(max-width: 841px) 100vw, 841px\" \/><figcaption>Step 2) cPanel Email Routing Local Mail Exchanger<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Upload to Host and Done<\/h2>\n\n\n\n<p>Once I had uploaded my modified files including the new contact_us_action.php file onto the server I was able to use the contact us form.  I didn&#8217;t have to install special PHP email libraries and mess with 3rd party email configurations which was awesome. <\/p>\n\n\n\n<p>If you are looking for more information I recommend checking out the following namecheap article: <\/p>\n\n\n\n<p><a href=\"https:\/\/www.namecheap.com\/support\/knowledgebase\/article.aspx\/10038\/31\/how-to-configure-a-contact-form-with-us\">https:\/\/www.namecheap.com\/support\/knowledgebase\/article.aspx\/10038\/31\/how-to-configure-a-contact-form-with-us <\/a><\/p>\n\n\n\n<p> Good Luck and Happy Coding! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>So you downloaded an amazing website template that you just can&#8217;t wait to work with. You were able to customize the whole template except for the contact form part. You realize that it takes some backend work in order for&#8230; <a class=\"more-link\" href=\"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[8,39],"tags":[50,46,48,47],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How I Got a Contact Us Form Inside a HTML Template to Work - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding<\/title>\n<meta name=\"description\" content=\"You got a fancy new HTML website template but the contact us form doesn&#039;t work :( Here is one of the fastest ways to get it to work using PHP.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How I Got a Contact Us Form Inside a HTML Template to Work - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding\" \/>\n<meta property=\"og:description\" content=\"You got a fancy new HTML website template but the contact us form doesn&#039;t work :( Here is one of the fastest ways to get it to work using PHP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/\" \/>\n<meta property=\"og:site_name\" content=\"AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-08T20:29:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-08T20:33:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts.png\" \/>\n<meta name=\"author\" content=\"avansardar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"avansardar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/\",\"url\":\"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/\",\"name\":\"How I Got a Contact Us Form Inside a HTML Template to Work - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding\",\"isPartOf\":{\"@id\":\"https:\/\/avantutor.com\/blog\/#website\"},\"datePublished\":\"2019-05-08T20:29:21+00:00\",\"dateModified\":\"2019-05-08T20:33:14+00:00\",\"author\":{\"@id\":\"https:\/\/avantutor.com\/blog\/#\/schema\/person\/3a1820bcdd71870ace675436f371be9e\"},\"description\":\"You got a fancy new HTML website template but the contact us form doesn't work :( Here is one of the fastest ways to get it to work using PHP.\",\"breadcrumb\":{\"@id\":\"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/avantutor.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How I Got a Contact Us Form Inside a HTML Template to Work\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/avantutor.com\/blog\/#website\",\"url\":\"https:\/\/avantutor.com\/blog\/\",\"name\":\"AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding\",\"description\":\"Looking for expert advice on how to improve your coding skills? The AvanTutor blog provides a wealth of resources and insights to help you become a better programmer. Our experienced tutors share tips and tricks for mastering popular programming languages such as Java, and JavaScript, as well as insights into the latest trends in software development. With regular updates and engaging content, the AvanTutor blog is your go-to resource for all things coding.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/avantutor.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/avantutor.com\/blog\/#\/schema\/person\/3a1820bcdd71870ace675436f371be9e\",\"name\":\"avansardar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/avantutor.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/81392f2a2c93b7b1c7479ed6b4115f02?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/81392f2a2c93b7b1c7479ed6b4115f02?s=96&d=mm&r=g\",\"caption\":\"avansardar\"},\"url\":\"https:\/\/avantutor.com\/blog\/author\/avansardar\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How I Got a Contact Us Form Inside a HTML Template to Work - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding","description":"You got a fancy new HTML website template but the contact us form doesn't work :( Here is one of the fastest ways to get it to work using PHP.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/","og_locale":"en_US","og_type":"article","og_title":"How I Got a Contact Us Form Inside a HTML Template to Work - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding","og_description":"You got a fancy new HTML website template but the contact us form doesn't work :( Here is one of the fastest ways to get it to work using PHP.","og_url":"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/","og_site_name":"AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding","article_published_time":"2019-05-08T20:29:21+00:00","article_modified_time":"2019-05-08T20:33:14+00:00","og_image":[{"url":"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2019\/05\/Email_Accounts.png"}],"author":"avansardar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"avansardar","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/","url":"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/","name":"How I Got a Contact Us Form Inside a HTML Template to Work - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding","isPartOf":{"@id":"https:\/\/avantutor.com\/blog\/#website"},"datePublished":"2019-05-08T20:29:21+00:00","dateModified":"2019-05-08T20:33:14+00:00","author":{"@id":"https:\/\/avantutor.com\/blog\/#\/schema\/person\/3a1820bcdd71870ace675436f371be9e"},"description":"You got a fancy new HTML website template but the contact us form doesn't work :( Here is one of the fastest ways to get it to work using PHP.","breadcrumb":{"@id":"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/avantutor.com\/blog\/contact-us-form-html-template-to-work\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/avantutor.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How I Got a Contact Us Form Inside a HTML Template to Work"}]},{"@type":"WebSite","@id":"https:\/\/avantutor.com\/blog\/#website","url":"https:\/\/avantutor.com\/blog\/","name":"AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding","description":"Looking for expert advice on how to improve your coding skills? The AvanTutor blog provides a wealth of resources and insights to help you become a better programmer. Our experienced tutors share tips and tricks for mastering popular programming languages such as Java, and JavaScript, as well as insights into the latest trends in software development. With regular updates and engaging content, the AvanTutor blog is your go-to resource for all things coding.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/avantutor.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/avantutor.com\/blog\/#\/schema\/person\/3a1820bcdd71870ace675436f371be9e","name":"avansardar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/avantutor.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/81392f2a2c93b7b1c7479ed6b4115f02?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/81392f2a2c93b7b1c7479ed6b4115f02?s=96&d=mm&r=g","caption":"avansardar"},"url":"https:\/\/avantutor.com\/blog\/author\/avansardar\/"}]}},"_links":{"self":[{"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/posts\/247"}],"collection":[{"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/comments?post=247"}],"version-history":[{"count":3,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/posts\/247\/revisions"}],"predecessor-version":[{"id":257,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/posts\/247\/revisions\/257"}],"wp:attachment":[{"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/media?parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/categories?post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/tags?post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}