carter/mailer

此包用于发送电子邮件。

v1.0.3 2019-07-11 05:37 UTC

This package is auto-updated.

Last update: 2024-09-06 23:10:58 UTC


README

##Mailer包Issues Forks Stars

此包用于发送电子邮件

如何安装

您可以通过运行以下Composer命令来安装此包:

composer require carter/mailer

运行以下命令并发布

php artisan vendor:publish

发布后,您将在config文件夹中找到一个名为"mailer.php"的新文件。请在该文件中添加必要的详细信息。

##在控制器中使用方法

首先,您需要在"config/app.php"的provider部分添加以下行:

Carter\Mailer\MailerServiceProvider::class,

在您的控制器中添加以下行

use Mailer;

##如何使用此包发送邮件

您可以通过添加以下代码行来使用此包发送邮件:

$to="yourmail@example.com";
#or
$to=array('yourmail@example.com'=>'YourName','secondmail@example.com'=>'SecondName');

$subject="Subject of the email";
$message="Body of your message" #you can also load the view in your message

$result=Mailer::sendmail($to,$subject,$message);