![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
[PHP]
<?php
// --------------------------------------------------------------------------- //
// Create By arzen(孟远螓);
//
// In (深圳福田区农科中心);
//
// QQ:3440895;
//
// Email:arzen1013@yahoo.com.cn;arzen10132@hotmail.com;
//
// Date:2004-6-11 ;
//
// --------------------------------------------------------------------------- //
/**
* @package kernel
* @author 孟远螓
* $subject 邮件标题
* $mail_to 目标邮箱
* $mail_from 寄出邮箱
* $key_220(表单标题)
value_220(表单内容)
*/
class Feedback
{
/**
* 处理表单提交变量函数
*/
function handlingForm()
{
@extract($_POST);
for($i=220; $i<250; $i++)
{
$VarKey = 'key_'.$i;
$VarValue = 'value_'.$i;
if($$VarKey)
{
$str .= $$VarKey.":\t".$$VarValue."\n";
}
}
Return $str;
}
/**
* 发送处理邮件函数
*/
function sendMail()
{
global $ClassPath;
@extract($_POST);
$header = "From: $mail_from\r\n" ."Reply-To: $mail_from\r\n"."Return-Path: $mail_from\r\n";
$subject = $subject."--Webserver";
$Message = $this->handlingForm();
$Message .= $this->copyRight();
mail($mail_to,$subject,$Message,$header);
echo "20秒后自动关闭,您发送的内容如下:
", $Message, ""; $this->autoClose(); } /** * 发送处理邮件函数 */ function copyRight() { $dates = date("Y/m/d H:i:s"); $Message = " 日期
dates
Thank you
您的管理团队
-----------------------------------------------------------------------
Webserver1.0 您的管理团队 QQ:3440895
";
Return $Message;
}
/**
* 自动关闭窗口函数
* @param $second 秒
*/
function autoClose($second=20)
{
$second = $second*1000;
echo "<script> setTimeout('window.close()',$second)</script>";
}
}
?>
[/PHP]
使用范例
[PHP]
<?php
include_once ("Feedback.class.php");
$FeedbackObj = new Feedback;
if($_POST['todo'] == "Y")
{
$FeedbackObj->sendMail();
}
?>

