如果没有自己的邮件服务器 用phpmailer可以发送邮件 
http://baike.baidu.com/view/2341560.htm?fr=ala0_1

解决方案 »

  1.   

    给你部分代码?看看:
    $email = trim($_POST['email']);
    $hometel = htmlspecialchars($_POST['comment']);
    $validt = trim($_POST['validt']);
        if($_SESSION[checkkey] <> $validt && $validt)
         {
          echo '<script>alert("验证码输入不正确!");</script>';
    }else{
    //判断各自段是否为空!!
    if($username != "" && $email != "" && $pwd != "" && $name!="" && $sex!="" && $date!="" && $dates!="" && $sf!="" && $tp!="" && $address!="" && $hometel!="" && $validt!=""){
    $template = file_get_contents('template.html');
    $template = str_replace('{username}',$username,$template);
    $template = str_replace('{userpwd}',$pwd,$template);
    $template = str_replace('{textname}',$name,$template);
    $template = str_replace('{gender}',$sex,$template);
    $template = str_replace('{year}',$date,$template);
        $template = str_replace('{month}',$dates,$template);
    $template = str_replace('{day}',$datese,$template);
    $template = str_replace('{sf}',$sf,$template);
    $template = str_replace('{contact_num0}',$tp,$template);
    $template = str_replace('{city}',$address,$template);
    $template = str_replace('{email}',$email,$template);
    $template = str_replace('{comment}',$hometel,$template);
    $content = $template;      //  *********************************** echo "$content";
    require_once ('sendmail.php');//发送邮件类
    ####################--发邮件--####################
    $smtpserver  =  "smtp.126.com";//SMTP服务器
    $smtpserverport = 25;//SMTP服务器端口
    $smtpusermail  =  "";//SMTP服务器的用户邮箱
    $smtpuser  =  "axiebin";//SMTP服务器的用户帐号
    $smtppass  =  "";//SMTP服务器的用户密码 $smtpemailto  =  $email;//发送给谁
    $mailsubject  = "会员密码回函";//邮件主题
    $mailtime = date("Y-m-d H:i:s");
    $mailbody  = $content; //邮件内容 $mailtype  =  "HTML";//邮件格式(HTML/TXT),TXT为文本邮件
      

  2.   

    使用POST 文本框接过值,然后照着我写的代码套着用就可以了,我那些发法完整,需要你到网上找,自己研究研究吧