get.php
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
请填写您在这里注册的电子邮箱地址,我们会将您的ID及口令,注册号发送到您的邮箱里。 <br>
<form name="form1" method="post" action="getpassword1.php">
  <input name="mail" type="text" id="mail">
  <input type="submit" name="submit" value="提交">
</form>
</body>
</html>got.php
<?php
if(isset($HTTP_POST_VARS['submit']) && $HTTP_POST_VARS['submit']!='')
{
$sql= "SELECT * FROM $member_individual INNER JOIN $member_corporation ON $member_individual.email = $member_corporation.email where $member_individual.email='".$HTTP_POST_VARS['mail']."'";
$result=mysql_query($sql);
$num=mysql_num_rows($result);
echo "<br>";
echo "num=".$num."<br>";
if($num > 0)
{
$sql_user= "SELECT * FROM $member_individual INNER JOIN $member_corporation ON $member_individual.email = $member_corporation.email where $member_individual.email='".$HTTP_POST_VARS['mail']."'";
$query_user = mysql_query($sql_user);
$row_user = mysql_fetch_array($query_user);
sendSmallEmail($row_user['email'], "发送密码",$row_user['password'], $emailMode="text","bonnie");
echo "OK!";
}
else
{
echo "您输入的E_mail不正确!!";
}
}
function sendSmallEmail($to, $subject, $msg, $emailMode="text",$emailFrom)
    {
        //发送htm邮件
if ($emailMode=="html")
{
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$emailFrom."\r\n";
$headers .= "Cc: [email protected]\r\n";
$headers .= "Bcc: [email protected]\r\n";
}
//发送普通文本
        if ($emailMode=="text")
        {
            $headers .= "From: ".$emailFrom."\r\n";
$msg .="\n_欢迎";
}
//执行发送操作,并返回结果
     if(@mail($to, $subject, $msg, $headers)) {
            return 1;
        }
        else 
        {
            Return 0;
        }     
    } //end func 
?>