- Sep 18, 2002
- 3,884
- 0
- 76
i signed up for moreweb web hosting a while back through AT Hot Deals. i wanted to try creating a form that would contain info, and when submitted, an email would be sent to me.
i looked around and found that there is a mail() function in php. however, i can't seem to get it to work. here's my simple prototype code:
test.htm:
testsend.php:
all i did was copy the two files to my web host. i access the html file, and press the submit button, but i'm not gettin any email
anyone know if there's anything else i can do to utilize this script?
thanks in advance for helping out a n00b
i looked around and found that there is a mail() function in php. however, i can't seem to get it to work. here's my simple prototype code:
test.htm:
<HTML>
<HEAD>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<form name="f1" action="testsend.php" method="post">
<p align="left">
<input type="submit" name="Submit" value="Submit">
</form>
</BODY>
</HTML>
testsend.php:
<?php
$Name = "Test"; //senders name
$email = "test@gmail.com"; //senders e-mail adress
$recipient = "test@gmail.com"; //recipient
$mail_body = "The text for the mail..."; //mail body
$subject = "Subject"; //subject
$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
mail($recipient, $subject, $mail_body, $header); //mail command
?>
all i did was copy the two files to my web host. i access the html file, and press the submit button, but i'm not gettin any email
thanks in advance for helping out a n00b
