当前位置:网站首页>Send email to laravel
Send email to laravel
2022-04-23 20:43:00 【Chen qingnuo language】
laravel Core points of email sending : Need to use Mail object
1、 First, configure... In the mailbox : Turn on 【POP3/SMTP service 】
Generate the key
2、 stay .env Middle configuration
MAIL_MAILER=smtp
MAIL_HOST=smtp.qq.com
MAIL_PORT=465
[email protected]// Your email account
MAIL_PASSWORD=// Turn on qq mailbox SMTP The authorization password obtained after
MAIL_ENCRYPTION=ssl
[email protected]// Your email account
MAIL_FROM_NAME="${APP_NAME}"
3、 Operate in the controller : introduce Mail object
use Illuminate\Support\Facades\Mail;
4、 Add mail sending method :
// Direct text sending
Mail::raw(' Test mail ',function ($message){
$message->from('[email protected]// Your email account ',' Test mail ');
$message->subject('hhhhhhhh');
$message->to('[email protected]// Your email account ');
});
$qq = '[email protected]// Your email account ';
// Use blade Template send ( Referenced template )
Mail::send('mailtest',['name' => 'test'],function($message)use($qq){
$message->to($qq)->subject('hhhhhhh');
});
5、 If you use blade Template send , You need to add the corresponding blade Templates , For example, in /view Add under directory mailtest.blade.php Templates
<p>hello {
{$name}}</p>
版权声明
本文为[Chen qingnuo language]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204232042380674.html
边栏推荐
- Latex formula
- 2021-09-02 unity project uses rider to build hot change project failure record of ilruntime
- Use of node template engine
- Elastic box model
- SQL: query duplicate data and delete duplicate data
- The construction and use of Fortress machine and springboard machine jumpserver are detailed in pictures and texts
- Matlab matrix index problem
- Leetcode 542, 01 matrix
- Syntaxerror: unexpected token r in JSON at position 0
- 缓存淘汰算法初步认识(LRU和LFU)
猜你喜欢
LeetCode 542、01 矩阵
Leetcode 542, 01 matrix
How to configure SSH public key in code cloud
高薪程序员&面试题精讲系列91之Limit 20000加载很慢怎么解决?如何定位慢SQL?
Identification of bolt points in aerial photography based on perception
Go language development Daily Fresh Project Day 3 Case - Press Release System II
內網滲透之DOS命令
A useless confession artifact
LeetCode 74、搜索二维矩阵
居家第二十三天的午饭
随机推荐
Leetcode 994, rotten orange
2021-06-29 C escape character cancellation and use
[matlab 2016 use mex command to find editor visual studio 2019]
中创存储|想要一个好用的分布式存储云盘,到底该怎么选
Leetcode 1351. Negative numbers in statistical ordered matrices
MySQL进阶之常用函数
SQL gets the latest record of the data table
ABAQUS script email auto notification
Shanghai a répondu que « le site officiel de la farine est illégal »: l'exploitation et l'entretien négligents ont été « noirs » et la police a déposé une plainte
【PTA】L1-002 打印沙漏
The problem of 1 pixel border on the mobile terminal
UnhandledPromiseRejectionwarning:CastError: Cast to ObjectId failed for value
Come in and teach you how to solve the problem of port occupation
Fastdfs思维导图
vulnhub DC:1渗透笔记
Scripy tutorial - (2) write a simple crawler
Some basic knowledge of devexpress report development
Vscode download speed up
XXXI` Prototype ` displays prototype properties and`__ proto__` Implicit prototype properties
Leetcode 74. Search two-dimensional matrix