Menu
Web Host Pro logo
  • Home
  • News
  • Servers
  • Websites
  • WordPress
  • 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

← Security Advisory: OpenSSL vulnerability (CVE-2014-0160)
Web hosting for PHP 5.3 →

Connect with us

Web Host Pro

Recent Posts

  • Massive Data Center Upgrade Finished!

    Massive Data Center Upgrade Finished!

  • OpenCart vs. Shopify

    OpenCart vs. Shopify

  • How Web Host Pro Empowers Entrepreneurs

    How Web Host Pro Empowers Entrepreneurs

  • The Best Way to Drive Traffic to Your Website: A Comprehensive Guide

    The Best Way to Drive Traffic to Your Website: A Comprehensive Guide

  • Unveiling Domain Privacy

    Unveiling Domain Privacy

  • Transforming Search With OpenAI

    Transforming Search With OpenAI

  • From Zero to $10K: My Journey to Making Money Online with Affiliate Marketing

    From Zero to $10K: My Journey to Making Money Online with Affiliate Marketing

  • Unlocking Business Efficiency with AI

    Unlocking Business Efficiency with AI

  • Unlocking Your Creativity

    Unlocking Your Creativity

  • Why Remote Work in 2024 is Perfect for Aspiring Digital Nomads

    Why Remote Work in 2024 is Perfect for Aspiring Digital Nomads

  • Unleash Your Inner Lion

    Unleash Your Inner Lion

  • Building a Successful Landing Page with Web Host Pro's SiteJet Website Builder

    Building a Successful Landing Page with Web Host Pro's SiteJet Website Builder

  • Navigating the World of Business Services: Understanding Advertising, Promotion, Publicity, and More

    Navigating the World of Business Services: Understanding Advertising, Promotion, Publicity, and More

  • System Admin Services for cPanel-Based Servers

    System Admin Services for cPanel-Based Servers

  • Using FileZilla and Cyberduck with WordPress

    Using FileZilla and Cyberduck with WordPress

Log in
©2025 Web Host Pro