box-o-sand/docroot/html/mailing.php

46 lines
1.1 KiB
PHP
Raw Normal View History

2010-12-31 07:57:02 +00:00
<?php
require_once("_head.php");
mkheader("looping!", "#eee");
?>
<body>
<!-- ======================================================= -->
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
mail(
$_POST['email-toaddr'],
$_POST['email-subject'],
$_POST['email-message'],
"From: {$_SERVER['PHP_SELF']} <php@localhost>"
);
?><p>Sent!</p><p><a href="<?php echo $_SERVER['PHP_SELF']; ?>">clear this</a></p><?php
} else {
?>
<form name="email-send" action="" method="POST">
<label for="email-toaddr">To:</label>
<input type="text" id="email-toaddr" name="email-toaddr" />
<label for="email-subject">Subject:</label>
<input type="text" id="email-subject" name="email-subject" />
<label for="email-message">Message:</label>
<textarea name="email-message" id="email-message" rows="10" cols="80"></textarea>
<input type="submit" name="email-submit" value="Send" />
</form>
<?php
}
?>
</body>
</html>