email form on website help

5 replies
  • WEB DESIGN
  • |
hi guys need your help.

I want my customers to fill out a form which then gets sent to me via email.

I've seen it used for contact pages.

just wondering if anyone knows of a template or even better if there is a wordpress plugin?

thanks
DAN
#email #form #website
  • Profile picture of the author JonathanKrantz
    There's bound to be a wordpress plugin, but if you're using PHP, the code should be something like this:

    This is a sample HTML of the form:
    Code:
     <form action="sendmail.php" method="post">
     Your name: <input type="text" name="yourname" value="" />
     <input type="submit" value="send" />
     </form>
    this is a sample email script for the sendmail.php:
    Code:
     $recipient = "yourmail@somewhere.tld";
     $subject = "This is the subject";
     $fromname = "Sender name";
     $fromaddress = "sendermail@somewhere.tld";
     $headers = "Content-type: text/html; charset=UTF-8\n";
     $headers .= "From: \"".$fromname."\" <".$fromaddress.">\n";
     $forminfo = "Visitor has entered: ".$_POST['yourname'];
     mail("$recipient", "$subject", "$forminfo", "$headers");
     header("Location: index.html");
    Everything sent by the post method is stored in the $_POST array. The keys are the name attributes of the inputs.
    {{ DiscussionBoard.errors[2193447].message }}
    • Profile picture of the author osegoly
      Hi,

      I use a WordPress plugin called cforms2 for all my forms, including mailing lists forms (simple form with name and email fields) and it works great, highly customizable, and comes with an easy-to-use back-end.

      Hope that helps.
      {{ DiscussionBoard.errors[2193691].message }}
      • Profile picture of the author danjensen
        thanks guys i'll give it a try thanks
        {{ DiscussionBoard.errors[2193719].message }}
  • Profile picture of the author BMboyz
    for me..

    if using wordpress ..there is a plugin called "Contact7" just nice...
    {{ DiscussionBoard.errors[2193804].message }}

Trending Topics