Home > Backend Development > PHP Tutorial > [Mr. Mai] Implement email verification in the Laravel framework---send emails, laravel---_PHP tutorial

[Mr. Mai] Implement email verification in the Laravel framework---send emails, laravel---_PHP tutorial

WBOY
Release: 2016-07-12 08:51:46
Original
1473 people have browsed it

[Mr. Mai] Implemented email verification in the Laravel framework---sending emails, laravel---

After using it for a period of time, I found that there are many places in the project User verification is required, with SMS verification and email verification being the mainstream trends. Xiaomai summarized how to implement SMS verification if the email sending function is implemented in the Laravel framework.

  

  

Under .env file

1. Configure Laravel files

MAIL_DRIVER=smtp //It is recommended to use smtp method

MAIL_HOST=smtp.163.com //It is recommended to use 163 mailbox, QQ mailbox will report an error

MAIL_PORT=25 //smtp default is 25

MAIL_USERNAME=null //My own 163 account

MAIL_PASSWORD=null //Client password

MAIL_ENCRYPTION=null

.

2. Modify

in the config/email.php file

                            'from' => Write your own 163 address

3. Register 163’s email address and set up your email account. Turn on POP3/SMTP/IMAP and enable the authorization code and perform mobile phone verification

4. Refer to the Laravel manual for sending emails

It must be noted that when the controller quotes the email to send, it must first quote use Mail

​ ​ ​ ​ ​​​​Send email test

​ ​ ​ ​ ​ ​Set in routing

  

​ ​ ​ ​ ​ ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​Write the method in the controller

    

                                                                                                 

                                                                                                                                             

​ ​ ​ ​ ​ ​ ​​​​​​​​​​​​​​​​​​​​​​​2.$message->subjuet(''); is the title of the file

                                                                                                                 through

​ ​ ​ ​

This is a list of methods that can be used in

message generator instances:

$message                                                      

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1128120.htmlTechArticle[Mr. Mai] Implement email verification in the Laravel framework---send emails, laravel--- after a period of After using it for a long time, I found that user verification is needed in many places in the project, such as SMS verification and...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template