...

View Full Version : simple e-mail script



tricolaire
08-22-2006, 01:13 AM
here is the script:


<html>

<head>

<title>Send an e-mail!</title>

</head>

<body>

<?php

if($_POST['address']){

$address=$_POST['address'];

if(!$_POST['subject']){

print<<<_HTML_
<form method="post" action="$_SERVER[PHP_SELF]">
E-mail: <input type="text" name="address" value="$address">
<br/>
Enter a subject: <input type="text" name="subject">
<br/>
<input type="submit" value="Submit">
</form>
_HTML_;

}else{

$address=$_POST['address'];
$subject=$_POST['subject'];

if(!$_POST['body']){

print<<<_HTML_
<form method="post" action="$_SERVER[PHP_SELF]">
E-mail: <input type="text" name="address" value="$address">
<br/>
Subject: <input type="text" name="subject" value="$subject">
<br/>
Body: <input type="textarea" name="body" rows="10" columns="10">
<br/>
<input type="submit" value="Send">
</form>
_HTML_;

}else{

$body=$_POST['body'];

print "email has been sent to:\n$address";

mail($addresse,$subject,$body);

}

}

}else{

print<<<_HTML_
<form method="post" action="$_SERVER[PHP_SELF]">
Enter an e-mail address: <input type="text" name="address">
<br/><br/>
<input type="submit" value="Submit">
</form>
_HTML_;

}

?>

</body>

</html>

I typed in my own e-mail address, and never recieved the e-mail

how do I get this thing to actually send $body?

TIA

Fumigator
08-22-2006, 01:18 AM
mail($addresse,$subject,$body);

Spellchecking your variables will help...

tricolaire
08-22-2006, 01:19 AM
ah, many thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum