Menu
web host pro logo
  • Home
  • News
  • Servers
  • Websites
  • Business
web host pro logo
web host pro
May 29, 2014February 19, 2024

Simple formmail example

Share it here

Here is a simple cut-and-paste form with a couple variables you can change.

It uses Formmail already added to every web hosting account in your cPanel with Web Host Pro. You will need to have an email set up and working in the account you add the form to.

Here is the example and code (WordPress will not let us add the code here without it trying to change it)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Contact Form</title>
</head>
<body>

    <h2>Contact Us</h2>

    <form action="http://yourdomain.com/cgi-bin/FormMail.pl" method="post">
        <input type="hidden" name="recipient" value="your@email.com">
        <input type="hidden" name="subject" value="Website Inquiry">
        <input type="hidden" name="redirect" value="http://yourdomain.com/thank-you.html">
        
        <label for="name">Name:</label><br>
        <input type="text" id="name" name="name" required><br>
        
        <label for="email">Email:</label><br>
        <input type="email" id="email" name="email" required><br>
        
        <label for="message">Message:</label><br>
        <textarea id="message" name="message" rows="4" required></textarea><br>
        
        <input type="submit" value="Send">
    </form>

</body>
</html>

Key Elements of the Form:

  • Action: This attribute should point to the URL of your FormMail script (e.g., FormMail.pl or formmail.cgi).
  • Method: The method post is used to submit form data as part of the HTTP request body, keeping it invisible in the URL.
  • Input Fields: The name attribute for each input field is crucial because FormMail uses these names to process the form data. Make sure they are correctly set and match what your FormMail script expects.
  • Hidden Fields:
    • recipient: The email address where you want the form data sent.
    • subject: The subject line for the email that’s generated.
    • redirect: The URL to redirect users to after the form is submitted successfully.

Security Note:

When using FormMail or any form-to-email script, it’s essential to ensure it’s configured securely to prevent abuse (e.g., spam). Many FormMail scripts have security features that need to be correctly set up. Always use the latest version of the script and follow the security guidelines provided by its developers.

Also, before deploying this form, make sure you have permission and the necessary rights to use FormMail or any similar scripts on your hosting server. Some hosting providers might restrict the use of such scripts due to security concerns.

Continue Reading

Web hosting for PHP 5.3 →

Connect with us
WordPress

Visit Web Host Pro Web Hosting, VPS, and Dedicated Servers

Recent Posts

  • A New Chapter: Web Host Pro Is Becoming HudsonHost

    A New Chapter: Web Host Pro Is Becoming HudsonHost

  • How to Manage Inodes and Improve Website Performance

    How to Manage Inodes and Improve Website Performance

  • Top 10 Reasons New Startups Fail

    Top 10 Reasons New Startups Fail

  • Marketing Basics for Building a Professional Web Presence

    Marketing Basics for Building a Professional Web Presence

  • Free Word Invoice Template

    Free Word Invoice Template

  • Website Content Filtering

    Website Content Filtering

  • cPanel and LiteSpeed Explained

    cPanel and LiteSpeed Explained

  • .htaccess Information, Tricks, and Tips

    .htaccess Information, Tricks, and Tips

  • How to Add a Web Host Pro Banner or Logo to Your Website

    How to Add a Web Host Pro Banner or Logo to Your Website

  • Softaculous App Web Hosting

    Softaculous App Web Hosting

  • How to Choose the Right Domain Name for Your Website

    How to Choose the Right Domain Name for Your Website

  • Web Host Pro AI Launch

    Web Host Pro AI Launch

  • What Is a Dedicated Server?

    What Is a Dedicated Server?

  • System Admin Services for cPanel-Based Servers

    System Admin Services for cPanel-Based Servers

  • Web Host Pro Reseller Hosting

    Web Host Pro Reseller Hosting

Popular Posts

Log in
All Rights Reserved Web Host Pro 2001-2026