require_once('email.class.php');
$mail = $_POST['edit']['mail'];
mysql_query($sql);$sql1="select mdname from tbl_reg where username='{$name}'";
$res=mysql_query($sql1);
$row = mysql_fetch_array($res);
echo $row['mdname'];
$smtpserver = "smtp.163.com";//SMTP服务器
$smtpserverport =25;//SMTP服务器端口
$smtpusermail = "发信人";//发信人
@$smtpemailto ="{$mail}";//收信人
$smtpuser = "邮箱";//smtp.163.com需要验证
$smtppass = "密码";
$mailsubject = "验证码";
@$mailbody = "<a href=http://localhost/shili123/user_system/do_reg.php?id=".$row['mdname'].">].链接"</a>";
$mailtype = "HTML";
$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);
$smtp->debug = FALSE;
$smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);