当前位置:网站首页>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
边栏推荐
- Leetcode 542, 01 matrix
- Leetcode 232, queue with stack
- Learn to C language fourth day
- C migration project record: modify namespace and folder name
- Resolve the eslint warning -- ignore the warning that there is no space between the method name and ()
- Summary and effect analysis of methods for calculating binocular parallax
- The construction and use of Fortress machine and springboard machine jumpserver are detailed in pictures and texts
- How to configure SSH public key in code cloud
- Latest investigation and progress of building intelligence based on sati
- Actual measurement of automatic ticket grabbing script of barley network based on selenium (the first part of the new year)
猜你喜欢

Identification of bolt points in aerial photography based on perception

Unity Odin ProgressBar add value column

2022DASCTF Apr X FATE 防疫挑战赛 CRYPTO easy_real

Unity animation creates sequence frame code and generates animationclip

Matlab: psychtoolbox installation

On BIM data redundancy theory

【栈和队列专题】—— 滑动窗口

MySQL基础之写表(创建表)

LeetCode 994、腐烂的橘子

"Meta function" of tidb 6.0: what is placement rules in SQL?
随机推荐
Preliminary understanding of cache elimination algorithm (LRU and LFU)
【PTA】L2-011 玩转二叉树
100天拿下11K,转岗测试的超全学习指南
Commande dos pour la pénétration de l'Intranet
Matlab analytic hierarchy process to quickly calculate the weight
MySQL进阶之数据的增删改查(DML)
6-5 string - 2 String copy (assignment) (10 points) the C language standard function library includes the strcpy function for string copy (assignment). As an exercise, we write a function with the sam
启牛学堂有用吗,推荐的证券账户是否安全
又一款数据分析神器:Polars 真的很强大
Learn to C language fourth day
C# 知识
Rt-1052 learning notes - GPIO architecture analysis
【PTA】整除光棍
LeetCode 1337、矩阵中战斗力最弱的 K 行
上海回应“面粉官网是非法网站”:疏于运维被“黑”,警方已立案
Unity asset import settings
一些接地气的话儿
Matlab: psychtoolbox installation
软件测试要怎么学?自学还是培训看完这篇文章你就懂了
Devexpress 14.1 installation record