Why can't I receive $ mail $ user_mail; $ randvalrandStr (6, & quot; ALL & quot;); $ randvalmd5 ($ randval); & nbsp; setcookie (mail_code2, $ randval, time () + 17 why can't I receive the mail successfully sent by phpmailer locally?
$ 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;
------ Solution --------------------
Phpmailer has the debug mode. when you enable the debug mode to report errors, you will know where the problem is.