thinkphp email verification
This article mainly introduces about thinkphp email verification, which has certain reference value. Now I share it with everyone. Friends in need can refer to it
Configuration file: config.php
return array( // 配置邮件发送服务器 'MAIL_HOST' =>'smtp.163.com',//smtp服务器的名称 'MAIL_SMTPAUTH' =>TRUE, //启用smtp认证 'MAIL_USERNAME' =>'thinkphp_wanlala@163.com',//你的邮箱名 'MAIL_FROM' =>'thinkphp_wanlala@163.com',//发件人地址 'MAIL_FROMNAME'=>'yoko',//发件人姓名 'MAIL_PASSWORD' =>'',//邮箱密码 'MAIL_CHARSET' =>'utf-8',//设置邮件编码 'MAIL_ISHTML' =>TRUE, // 是否HTML格式邮件
ControllerController:
1.Sent successfully
public function index(){ $this->display(); } public function doIndex(){ if(SendMail($_POST['mail'],$_POST['title'],$_POST['content'])){ $this->success('发送成功!'); } else{ $this->error('发送失败'); } }
public function Email(){ header("content-type:text/html;charset=utf-8"); $users = M('user'); $k = $_GET['k']; // print_r($k);exit; $row = $users ->where(array('code'=>$k))->find(); // print_r($row); exit(); if($row){ $id = $row['id']; $data['status'] = 1; $wan = $users->where($id)->save($data); $title = "尊敬的".$data['name']."欢迎使用验证方式,请点击下面链接进行验证"; $url = "<a href='http://localhost/collection/Home/User/email?k=".$keydate."'>立即激活</a>"; } else{ print '邮箱已激活'; } }
Front-end View:
<form action="{:U('User/doIndex')}" method="post" enctype="multipart/form-data"> 邮箱:<input type="text" id="mail" name="mail"/> 标题:<input type="text" id="title" name="title"/> 内容<input type="text" id="content" name="content"/> <input class="button" type="submit" value="发送" style="margin: 0 auto;display: block;"/> </form>
Related recommendations:
The above is the detailed content of thinkphp email verification. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











The Ouyi Exchange app supports downloading of Apple mobile phones, visit the official website, click the "Apple Mobile" option, obtain and install it in the App Store, register or log in to conduct cryptocurrency trading.

Sesame Open Door is a platform that focuses on cryptocurrency trading. Users can obtain portals through official websites or social media to ensure that the authenticity of SSL certificates and website content is verified during access.

Visit Binance official website and check HTTPS and green lock logos to avoid phishing websites, and official applications can also be accessed safely.

AI can help optimize the use of Composer. Specific methods include: 1. Dependency management optimization: AI analyzes dependencies, recommends the best version combination, and reduces conflicts. 2. Automated code generation: AI generates composer.json files that conform to best practices. 3. Improve code quality: AI detects potential problems, provides optimization suggestions, and improves code quality. These methods are implemented through machine learning and natural language processing technologies to help developers improve efficiency and code quality.

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

To cancel a Binance account, you need to complete the following steps: 1) Ensure all asset transfers, 2) Cancel all pending orders, 3) Unlock API keys, 4) Close all open contracts; then log in to Binance official website, enter the "User Center", select "Account Logout", fill in the reason for the cancellation, confirm the asset transfer, submit an application and wait for review, confirm the cancellation after the review is passed, and the account cannot be restored after the cancellation.

The download, installation and registration process of the Hong Kong Digital Currency Exchange app is very simple. Users can quickly obtain and use this app through the official app download link provided in this article. This article will introduce in detail how to download, install and register the Hong Kong Digital Currency Exchange app to ensure that every user can complete the operation smoothly.

MySQL functions can be used for data processing and calculation. 1. Basic usage includes string processing, date calculation and mathematical operations. 2. Advanced usage involves combining multiple functions to implement complex operations. 3. Performance optimization requires avoiding the use of functions in the WHERE clause and using GROUPBY and temporary tables.
