English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need a submit button that when clicked on sends the information to an email address. I have NO CLUE how to code it and it's driving me nuts.

Can anyone help me out by showing me how to, please?

2006-12-19 13:13:11 · 5 answers · asked by *♥Mrs. Morrow♥* 2 in Computers & Internet Programming & Design

All I need to know how to do is the button, I have the rest of the form done.

2006-12-19 13:16:09 · update #1

5 answers




Replace EMAIL_HERE with the email you want it sent to.
Hope this helps!

2006-12-19 13:22:12 · answer #1 · answered by James 3 · 1 0

What JAMES said.

The downside is that the user will be warned that they are sending via their own email program which reveals their address.....Also, the information is an attached .DAT file which you must open an read.

Upside, saves you from needing a backend process to send email.

2006-12-19 21:47:11 · answer #2 · answered by Jeffrey F 6 · 1 0

Use a "URL" along the lines
mailto:theemailaddress@server.com?subject=blah

2006-12-19 21:18:05 · answer #3 · answered by Anonymous · 1 1

here is what I did when I needed a form that would send me new recipes from my site.



















More input text fields here






First Name : * (25 max charaters)
Middle Name(s) or Initial : (25 max charaters)
Last Name : * (25 max charaters)
Email Address : * (50 max charaters)
 



The action='email.php' sends the info in the for to the page email.php... that is not visible by the viewers.. it builds the email and sends it via the server that hosts your site.
It looks like this. note: the variables below in $MyArray[] match the name='your_field_name' fields from the form above.

reset ($_POST);
while(list($key, $val) = each ($_POST))
{
$MyArray[] = "$val";
}

$FirstName = $MyArray[0];
$Middle = $MyArray[1];
$LastName = $MyArray[2];
$EmailAddress = $MyArray[3];
$City = $MyArray[4];
$State = $MyArray[5];
$RecipeName = $MyArray[6];
$Category = $MyArray[7];
$Ingredients = $MyArray[8];
$Description = $MyArray[9];
$PrepTime = $MyArray[10];
$CookTime = $MyArray[11];


$email = $EmailAddress;
$message = "First Name:\r\n" . $FirstName . "\r\n\r\n" .
"Middle:\r\n" . $Middle . "\r\n\r\n" .
"Last Name: \r\n" . $LastName . "\r\n\r\n" .
"City:\r\n" . $City . "\r\n\r\n" .
"State:\r\n" . $State . "\r\n\r\n" .
"RecipeName:\r\n" . $RecipeName . "\r\n\r\n" .
"Category:\r\n" . $Category . "\r\n\r\n" .
"Ingredients:\r\n" . $Ingredients . "\r\n\r\n" .
"Description:\r\n" . $Description . "\r\n\r\n" .
"Prep Time:\r\n" . $PrepTime . "\r\n\r\n" .
"Cook Time:\r\n" . $CookTime . "\r\n\r\n";

if (
mail("webmaster@{$_SERVER['SERVER_NAME']}",
"New Recipe",
$message,
"From: $email\r\n" .
"Reply-To: webmaster@{$_SERVER['SERVER_NAME']}\r\n" .
"X-Mailer: PHP/" .
phpversion())
)
{ header("Location: http://www.yourdomain.com/thanks.php?redirect=true&firstname=$FirstName&lastname=$LastName"); }
else
{ header("Location: http://www.yourdomain.com/thanks.php?redirect=false"); }

?>

2006-12-19 22:09:25 · answer #4 · answered by HughH 1 · 0 1

you must learn HTML application

2006-12-19 21:18:44 · answer #5 · answered by yang 2 · 0 2

fedest.com, questions and answers