当前位置:网站首页>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
边栏推荐
- How do BIM swindlers cheat? (turn)
- Devaxpress report replay: complete the drawing of conventional two-dimensional report + histogram + pie chart
- Automatically fill in body temperature and win10 task plan
- Thirty What are VM and VC?
- Unity solves Z-fighting
- [PTA] l1-006 continuity factor
- BMP JPEG picture to vector image contourtrace
- [PTA] l2-011 play with binary tree
- Recognition of high-speed road signs by Matlab using alexnet
- LeetCode 116. 填充每个节点的下一个右侧节点指针
猜你喜欢
C migration project record: modify namespace and folder name
3-5通过XSS获取cookie以及XSS后台管理系统的使用
Leetcode 74. Search two-dimensional matrix
LeetCode 116. 填充每个节点的下一个右侧节点指针
"Meta function" of tidb 6.0: what is placement rules in SQL?
High paid programmer & interview question series 91 limit 20000 loading is very slow. How to solve it? How to locate slow SQL?
【PTA】整除光棍
DOS command of Intranet penetration
How to configure SSH public key in code cloud
Syntax Error: TypeError: this. getOptions is not a function
随机推荐
[PTA] l1-006 continuity factor
Vscode download speed up
[stack and queue topics] - sliding window
缓存淘汰算法初步认识(LRU和LFU)
Solution: NPM err! code ELIFECYCLE npm ERR! errno 1
2021-09-02 unity project uses rider to build hot change project failure record of ilruntime
Create vs project with MATLAB
Development of Matlab GUI bridge auxiliary Designer (functional introduction)
Identification of bolt points in aerial photography based on perception
How to use PM2 management application? Come in and see
GSI-ECM工程建设管理数字化平台
bounding box iou
LeetCode 1346、检查整数及其两倍数是否存在
启牛学堂有用吗,推荐的证券账户是否安全
【PTA】L1-002 打印沙漏
学会打字后的思考
Leetcode 709, convert to lowercase
A login and exit component based on token
MySQL 存储过程和函数
Come in and teach you how to solve the problem of port occupation