在本地用phpmailer发送邮件成功为什么收不到
$mail = $user_mail;
$randval = randstr(6,all);
$randval = md5($randval);
setcookie('mail_code2',$randval,time()+172800,'/');
$code = $mail.'_'.$randval;
$code = base64_encode($code);
setcookie('mail_form_code',$code,time()+172800,'/');
$url=site_url('forget/reset/mail/'.$mail.'/e/'.$randval);
$body = $this->load->view('mail/content2', array('url'=>$url), true);
$body = eregi_replace([\],'',$body);
$this->phpmail->issmtp();
$this->phpmail->host = smtp.qq.com;
$this->phpmail->smtpauth = true;
$this->phpmail->host = smtp.qq.com;
$this->phpmail->port = 25;
$this->phpmail->username = 270687913@qq.com;
$this->phpmail->password = asdfg314159;
$this->phpmail->setfrom('270687913@qq.com', 'first last');
$this->phpmail->addreplyto(270687913@qq.com,first last);
$this->phpmail->msghtml($body);
$address = $mail;
echo $address;
$this->phpmail->addaddress($address, hello world!);
//$this->phpmail->send();
if(!$this->phpmail->send()) {
echo mailer error: . $this->phpmail->errorinfo;
} else {
echo message sent!;
}
exit();
return true;
------解决方案--------------------
phpmailer有debug模式,你开启debug模式让他报错误你就知道问题出在哪里了.