Get form emailed to me?

Mr. Duck

Seasoned Veteran
Joined
Jul 29, 2010
Messages
2,643
Reaction score
0
FP$
256
I am trying to get it so when someone clicks submit on my form it automatically emails me the data on the form. I am currently using mailto but when i click submit it just opens up outlook 😕

How can i get it automatically emailed to me?
 
You are not using PHP? Like:
Code:
mail("YourEmail", $subject, $message, $from);
 
Code:
<form action="mailto:[email protected]" method="get" enctype="text/plain">
  

                <p>Name:<br>
  <input type="text" size="30" name="Name"><br><br>
                  
                  Email:<br>
  <input type="text" size="30" name="Email"><br><br>
                  
                  Forum Name::<br>
  <input type="text" size="30" name="Forum Name"><br><br>
                  
                  Forum URL:<br>
  <input type="text" size="30" name="Forum URL"><br><br>
                  
                  Package Wanted:<br>
  <select>
  <option value="small">Small</option>
  <option value="medium">Medium</option>
  <option value="large">Large</option>
  <option value="xl">XL</option>
  <option value="custom">Custom</option>
</select>
<br>
                </p>
                <p> Extra Notes (Please Include where to post and where not to post, if it is a custom package please post how many posts, topics you want and post your paypal email.) <br>
  <textarea name="Other" cols="40" rows="10"></textarea>
                  <br />
  <br />
                  <input type="submit" value="Submit">
                </p>
              </form>
 
.Bob said:
Code:
<form action="mailto:[email protected]" method="get" enctype="text/plain">
  

                <p>Name:<br>
  <input type="text" size="30" name="Name"><br><br>
                  
                  Email:<br>
  <input type="text" size="30" name="Email"><br><br>
                  
                  Forum Name::<br>
  <input type="text" size="30" name="Forum Name"><br><br>
                  
                  Forum URL:<br>
  <input type="text" size="30" name="Forum URL"><br><br>
                  
                  Package Wanted:<br>
  <select>
  <option value="small">Small</option>
  <option value="medium">Medium</option>
  <option value="large">Large</option>
  <option value="xl">XL</option>
  <option value="custom">Custom</option>
</select>
<br>
                </p>
                <p> Extra Notes (Please Include where to post and where not to post, if it is a custom package please post how many posts, topics you want and post your paypal email.) <br>
  <textarea name="Other" cols="40" rows="10"></textarea>
                  <br />
  <br />
                  <input type="submit" value="Submit">
                </p>
              </form>

I'm going to make a couple of small changes to your form to make it a little more effecient. Here's the new form:

Code:
<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post" enctype="text/plain">
  

                <p>Name:<br>
  <input type="text" size="30" name="name"><br><br>
                  
                  Email:<br>
  <input type="text" size="30" name="email"><br><br>
                  
                  Forum Name::<br>
  <input type="text" size="30" name="forum_name"><br><br>
                  
                  Forum URL:<br>
  <input type="text" size="30" name="forum_url"><br><br>
                  
                  Package Wanted:<br>
  <select name="package">
  <option value="small">Small</option>
  <option value="medium">Medium</option>
  <option value="large">Large</option>
  <option value="xl">XL</option>
  <option value="custom">Custom</option>
</select>
<br>
                </p>
                <p> Extra Notes (Please Include where to post and where not to post, if it is a custom package please post how many posts, topics you want and post your paypal email.) <br>
  <textarea name="other" cols="40" rows="10"></textarea>
                  <br />
  <br />
                  <input type="hidden" name="form_sub" value="yes">
                  <input type="submit" value="Submit">
                </p>
              </form>

And the corresponding php code to process it:

Code:
<?php

if($_POST["form_sub"];
{
$name = $_POST["Name"];
$email = $_POST["email"];
$forum_name = $_POST["forum_name"];
$forum_url = $_POST["forum_url"];
$package = $_POST["package"];
$other = $_POST["other"];

$your_email = "your email here";

$mail_body = "Name: ".$name."\nEmail: ".$email.\nForum Name: ".$forum_name."\nForum Url: ".$forum_url."\nPackage: ".$package."\nOther Comments: ".$other;
$subject = "New Message";
$header = "From: ". $Name . " <" . $email . ">\r\n";

mail($your_email, $subject, $mail_body, $header);

echo "Thank you for your message.";
}

?>

And put the php code on the same page as the html form. I think that should do it, any errors post here or message me.
 
Do you have formmail on your cpanel or server? IF so, I can post the HTML that makes it work without any PHP code.
 
so i could just call it form.php then do i have to change any of the html to make it link to that
 
change the links on your other pages. all links that went to your html file before now will have to go to form.php
 
confused... do you have teamviewer - you could show me.

pm me your msn or gmail or whatever
 
You shouldn't have to change anything in form.php

But lets say I have index.html, and I have a link that went to form.html before, I will have to change that to go to form.php now. Because it is a new file. Other than that you should be set. If you know HTML it shouldn't be a problem.
 
Back
Top Bottom