PDA

View Full Version : php and mailing


rockstarmike
09-07-2002, 03:30 AM
hi, im still new to php.
i wondering if someone could give me a quick breakdown of the sendmail function, how i'd set it up and a few other pointers.
this is pretty much how i want it to function, given that i can do the same things i used to do with asp

Request strings from the form and make them variables
how do i do that
asp was like
sName = Request("name")

so i want do do that with a few different things
then
put it together like

to: mikey@noisefreedesign.com
from: sEmail
Body: sName <br> sPhone <br> sEmail <br> sBodytext

throw me a bone y0!

Nightfire
09-07-2002, 02:55 PM
This is typed on the fly, so there might be some errors


<?
if(!isset($submit)){
?>
<form action="<?=$PHP_SELF?>" method="post">
<input type="text" name="name">
<input type="text" name="phone">
<input type="text" name="email">
<textarea rows="20" cols="20" name="bodytext">
<input type="submit" value="Submit" name="submit">
</form>
<?
}else{
$myemail = "me@mydomain.com";
$subject = "You have a message from $name";
$body = "$name has sent you the following information.

His/her phone number is: $phone
His/her email is: $email
He/she has to say:
$bodytext";
mail($myemail,$subject,$body,"From: $email");
}
?>

brothercake
09-07-2002, 07:08 PM
http://www.php.net/manual/en/function.mail.php is very useful