i'm making a contact form here,
Question:
How to get message from client / user and send it to my email address.
When user click send button the user email address and message will be send to my acount.
Thx for all of your help...
i'm making a contact form here,
Question:
How to get message from client / user and send it to my email address.
When user click send button the user email address and message will be send to my acount.
Thx for all of your help...
You need to have a server side script (written in PHP for example).
The following tutorials might help:
How to make a web form
Email Form 'HowTo's
You can use a 'ready-made' form mail script as well.
thx for reply. That really help..
But is there another suggestion?
What i really need is just the code that get the value from the textfield and textarea and send it directly to my email account.
You definitely need to use a server side script like PHP.
These scripts can be very simple, I've posted examples of this in this forum before.
Here is a simple PHP script to create an email from data collected in a form:
The variables 'email' and 'message' are the names of input fields in your form.PHP Code:<?php
//variables
//form contents
$txtMessage=$_POST['message'];
$txtMail=$_POST['email'];
$txtMessage = str_replace(array("\n","\r"),'',$txtMessage);
$txtEmail = str_replace(array("\n","\r"),'',$txtMail);
$Myemail="your email address here";
$message ="Message :\t$txtMessage\n
\n"
$subject = "Message from - ".$txtEmail;
$mailheaders = "From: $txtEmail <> \n";
$mailheaders .= "Reply-To: $txtEmail\n\n";
//send mail
mail($Myemail, $subject, $message , $mailheaders);
?>
Save the above PHP to a php file, eg process.php, and in your <form> tag you add, method="POST" action="process.php".
This is a simple example of creating an email, you can add more fields from the input form quite easily.
davelf (09-10-2009)
hi, forum_amnesiac thx a lot for your help. I'll this at my contact form.
One last question:
is that possible to use javascript to make my contact form worked?
because i don't have any experience in PHP. So if there's javascript code to solve this problem, share with me please...
but one's again thx for forum_amnesiac and prasanthmj![]()
Nope - JavScript won't work, it's Client-Side, you need Server-Side.
Most modern hosting providers support PHP, if they don't, then you should really consider switching to a better host....
Cheers,
X96
Alex Blackie, X96 Design
My Website
I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration
davelf (09-10-2009)
oow, ok thx. Just want extra information.![]()
There are also things called "Remotely Hosted Scripts" which is just what you were looking for in your original post and only require a little bit of code that you have to place in your HTML page. Do a Google search for "Remote Hosted Contact Form".
Hope this helps.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
davelf (09-10-2009)
thx for all the reply, i've change my mind and follow all of your suggestion, i will use the php script to handle this contact form.![]()
Bookmarks