<?php
if (isset($_POST['submit']))
{
$mailto = $_POST['mailto'];
$subject = $_POST['subject'];
$message = $_POST['message'];
if (strlen($mailto) < 1)
{
$tip_mailto = "电子邮件不能为空";
}
else
if (strlen($subject) < 1)
{
$tip_subject = "主题不能为空";
}
else
if (strlen($message) < 1)
{
$tip_message = "内容不能为空";
}
else
{
$header = "From: XChinux<
hakusan@sohu.com>\r\n" .
"Reply-To:
hakusan@sohu.com\r\n" .
"X-Mailer: PHP/" . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-type: text/html; charset=gb2312\r\n";
$ret = mail($mailto, $subject, $message, $header);
if ($ret)
{
$tip_info = "发送成功";
}
}
}
?>
<html>
<head>
</head>
<body>
网络邮件发送系统
<form name="formMail" action="mail.php" method="POST">
<?=$tip_info?>
发送给谁:<input type="text" name="mailto" value=""><?=$tip_mailto?>
邮件主题:<input type="text" name="subject" value-""><?=$tip_subject?>
邮件内容:<textarea name="message" cols="60" rows="10"></textarea><?=$tip_message?>
<input type="submit" value="发送" name="submit">
</form>
</body>
</html>
[ 此贴被XChinux在2005-08-23 19:57重新编辑 ]