How to make simple form who sends all data to my email ?

ferma231

Elite Member
Joined
Jul 14, 2011
Messages
1,749
Reaction score
3,598
How to make simple registration form to send all data to my email ?

I have difficulties

I need to make form with email , phone, city and some comments and i want everything be sent to my email

But i have problems with :
Code:
<form action="MAILTO:[email protected]" method="post" enctype="text/plain">

If i click submit button , it just open gmail.com what i dont want, i want people to submit all info , they click submit and i receive they data. what should i do ?

Rep+ thanks Guaranted !

Full code -

Code:
<html><body>


<h3>Send e-mail to [email protected]:</h3>


<form action="MAILTO:[email protected]" method="post" enctype="text/plain">
Name:<br />
<input type="text" name="name" value="your name" /><br />
E-mail:<br />
<input type="text" name="mail" value="your email" /><br />
Comment:<br />
<input type="text" name="comment" value="your comment" size="50" />
<br /><br />
<input type="submit" value="Send">
<input type="reset" value="Reset">


</form>
</body>
</html>
 
You need to use a PHP script like :
PHP:
<?php
//define the receiver of the email
$to = '[email protected]';
//define the subject of the email
$subject = 'Test email'; 
//define the message to be sent. Each line should be separated with \n
$message = "Hello World!\n\nThis is my first mail."; 
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: [email protected]\r\nReply-To: [email protected]";
//send the email
$mail_sent = @mail( $to, $subject, $message, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" 
echo $mail_sent ? "Mail sent" : "Mail failed";
?>

And your form will be like :
HTML:
<form action="send.php" method="post" enctype="text/plain">

Beny
 
You need to use a PHP script like :
PHP:
<?php
//define the receiver of the email
$to = '[email protected]';
//define the subject of the email
$subject = 'Test email'; 
//define the message to be sent. Each line should be separated with \n
$message = "Hello World!\n\nThis is my first mail."; 
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: [email protected]\r\nReply-To: [email protected]";
//send the email
$mail_sent = @mail( $to, $subject, $message, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" 
echo $mail_sent ? "Mail sent" : "Mail failed";
?>

And your form will be like :
HTML:
<form action="send.php" method="post" enctype="text/plain">

Beny

Thanks. Now i need to learn about php scripts :D
 
For anyone who's scared of using php, or doesn't have the time to figure it out, there are wp plugins that do this too. These include Contact form 7, which has a very nice dynamic text extension that lets it do cool stuff; and Easy contact forms.
 
For anyone who's scared of using php, or doesn't have the time to figure it out, there are wp plugins that do this too. These include Contact form 7, which has a very nice dynamic text extension that lets it do cool stuff; and Easy contact forms.

Okey will take a look at this :)

Thanks
 
For anyone else, and you too, Jot form is the easiest I've used. I can't post a link because I'm new but just Google "Jot form"
 
Back
Top