


Implement sending email instance (email verification) in Laravel framework, laravel sends email_PHP tutorial
Jul 12, 2016 am 08:50 AMImplement sending email instance (email verification) in Laravel framework, laravel sends email
After using it for a period of time, I found that user verification is needed in many places in the project , with SMS verification and email verification as the mainstream trends, the editor of this article summarizes how to implement the email sending function in the Laravel framework. In the future, we will continue to update how to implement SMS verification....
Under the .env file
1. Configure Laravel file
MAIL_DRIVER=smtp //It is recommended to use smtp method
MAIL_HOST=smtp.163.com //It is recommended to use 163 mailbox and 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' => ['address' => null, 'name' => null], //There is no prompt in the manual, but in actual application, if addredd=>null, an error will be reported, which will take days Write your own 163 address
3. Register 163’s email address and set up your email account Enable 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
Writing methods in the controller
????????????Among them
?????????????1:Mail::raw is used to send native data, other content sending methods are provided in the manual;
?????????????2.$message->subjuet(''); is the title of the file
?????????????3.$message->to();To whom to send
This is a list of methods that can be used in $message
message generator instances:
$message->from($address, $name = null); $message->sender($address, $name = null); $message->to($address, $name = null); $message->cc($address, $name = null); $message->bcc($address, $name = null); $message->replyTo($address, $name = null); $message->subject($subject); $message->priority($level); $message->attach($pathToFile, array $options = []); // 以原始 $data 字符串附加一個文件... $message->attachData($data, $name, array $options = []); // 獲取底層的 SwiftMailer 消息實(shí)例... $message->getSwiftMessage();
????????

Hot AI Tools

Undress AI Tool
Undress images for free

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

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

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

?In today's increasingly popular digital asset trading, it is particularly important to understand how to safely and effectively withdraw your digital assets. As a world-renowned digital asset trading platform, ok exchange provides convenient currency withdrawal services. This tutorial will analyze in detail the steps of withdrawing coins on the ok exchange, things to note, and some common questions and answers to help users complete asset transfer smoothly and ensure asset security. Whether you are using ok exchange for withdrawals for the first time or want to further understand the withdrawal process, this article will provide you with clear and practical guidance.

Ouyi OKX is one of the world's well-known digital asset trading platforms, providing users with safe, stable and rich trading products. This platform is committed to ensuring the security of users' assets and transaction experience. This article will provide you with links to the official page of Ouyi OKX. Click the link provided in this article to jump directly to the official homepage, thereby starting your digital asset journey.

The latest version of Binance is v2.102.5, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.

OKX is a world-renowned digital asset service platform, providing users with a wide variety of digital asset transaction and management services. With its safe and reliable system, massive trading categories and smooth user experience, OKX has become the choice of many users. This article aims to provide tutorials on downloading and installation of the official app. Users can quickly obtain the official genuine application by clicking on the download link provided in the article.

Choosing reliable altcoin transactions requires attention to compliance, liquidity, currency support, user experience and community reputation. 1. Priority is given to exchanges with formal regulatory licenses (such as FinCEN in the United States and MAS in Singapore) to ensure that the security measures of funds are perfect and there are no historical security incidents; 2. Check the transaction volume and bid-ask spread to judge liquidity; 3. Confirm that the platform launches high-quality altcoins and supports mainstream currency exchange; 4. Compare handling fees, withdrawal fees and interface friendliness; 5. Refer to Reddit, Twitter and other communities to evaluate and test customer service response speed. The transaction process includes registration verification, recharge of funds, selecting transaction pairs, placing orders and withdrawal management.

Dogecoin Trading App is a mobile trading platform specially designed for digital asset enthusiasts. It integrates market viewing, fast trading and asset management, and is committed to providing users with a safe, stable and convenient trading experience. Through this app, you can keep in mind the latest updates on digital assets such as Dogecoin anytime, anywhere. This article has compiled the latest official version of the app for you. Click the official download link provided in the article to easily obtain the latest version of the app.

?Binance is a world-renowned blockchain asset trading platform, providing users with diversified digital asset trading and related services, covering spot trading, derivative trading, asset management and other fields, and is committed to building a comprehensive blockchain ecosystem. This tutorial will provide you with detailed instructions on how to complete account registration on the Binance platform. This article has provided an official page link. Click the link in this article to safely jump to the official homepage and start your digital asset journey.

The latest version of Binance is v2.102.5, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.
