在当地用phpmailer发送邮件成功为什么收不到
程序员文章站
2024-01-15 18:35:58
...
在本地用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 = "[email protected]";
$this->phpmail->Password = "asdfg314159";
$this->phpmail->SetFrom([email protected]', 'First Last');
$this->phpmail->AddReplyTo("[email protected]","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模式让他报错误你就知道问题出在哪里了.
$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 = "[email protected]";
$this->phpmail->Password = "asdfg314159";
$this->phpmail->SetFrom([email protected]', 'First Last');
$this->phpmail->AddReplyTo("[email protected]","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模式让他报错误你就知道问题出在哪里了.
相关文章
相关视频
推荐阅读
-
在当地用phpmailer发送邮件成功为什么收不到
-
phpmailer 展示邮件发送成功 却收不到邮件?哪位大侠知道原因
-
在codeigniter的helper用phpmailer 发送邮件_PHP教程
-
在codeigniter的helper用phpmailer 发送邮件_PHP教程
-
在当地用phpmailer发送邮件成功为什么收不到
-
phpmailer 展示邮件发送成功 却收不到邮件?哪位大侠知道原因
-
phpmailer 展示邮件发送成功 却收不到邮件?哪位大侠知道原因
-
求教,在本地用QQ邮箱的SMTP为什么发送不了邮件,SMTP服务我开启了啊。
-
phpmailer 显示邮件发送成功 却收不到邮件?哪位大侠知道原因
-
phpmailer 显示邮件发送成功 却收不到邮件?哪位大侠知道原因