本文实例讲述了php发送邮件确认验证注册功能。分享给大家供大家参考,具体如下:
类库:
require "class.phpmailer.php";require "class.smtp.php";class php_mailer{ protected $mail; public function __construct() { $mail = new phpmailer; $mail->smtpdebug = 3; $mail->issmtp(); $mail->smtpauth = true; $mail->ishtml(true); $ci =& get_i卸磨杀驴nstance(); $ci->load->config('email_config'); $email = $ci->config->item('email'); foreach ($email as $key => $val驱使的意思ue) { $mail->$key = $value; } $this->mail = $mail; } public function check_ur($email,$nick,$txt,$爱的情书id) { $this->mail->fromname = '表白墙'; $thi第九届茅盾文学奖s->mail->addaddress("$email"); // add a recipient $this->mail->addreplyto('test@test.com', '表白墙反馈'); $this->mail->subject = '表白墙通知'; $this->mail->chart = "utf-8"; $this->mail->body = <<<body<p>你好:测试邮件body; $this-&青冥浩荡不见底gt;mail->altbody = <<<altbody你好:有一个altbody说:谢谢许愿墙的程序员 敬上! altbody; if ($this->mail->nd()) { returntrue; } elreturnfal; } }
调用
$this->load->library('email/php_mailer');$result = $this->php_mailer->check_ur('297538600@qq.com', 'aaa', '$row->txt', '$row->id');if ($result == true) { //更新状态 echo 'ok';}
待完善接收邮件验证的功能
邮件类下载地址:
本文发布于:2023-04-08 05:52:22,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/5a445af9a79cabc6c0650ae37c81b2cd.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:PHP发送邮件确认验证注册功能示例【修改别人邮件类】.doc
本文 PDF 下载地址:PHP发送邮件确认验证注册功能示例【修改别人邮件类】.pdf
留言与评论(共有 0 条评论) |