承接 leadm/leadmail 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

leadm/leadmail

最新稳定版本:v2.0.0

Composer 安装命令:

composer require leadm/leadmail

包简介

Laravel SDK for leadMail email sending and verification service

README 文档

README

Laravel package for sending emails and verifying email addresses through the leadMail service.

Requirements

  • PHP 8.2+
  • Laravel 11 or 12

Installation

composer require leadm/leadmail

Publish the config file:

php artisan vendor:publish --provider="LeadM\LeadMail\LeadMailServiceProvider"

Configuration

Add these to your .env:

LEADMAIL_URL=https://mail.leadmagnet.dev
LEADMAIL_TOKEN=lm_your_api_token_here

Optional settings:

LEADMAIL_TIMEOUT=30
LEADMAIL_VERIFY_SSL=true
LEADMAIL_AUTO_TENANT=true

Usage

Send Emails via Mail Driver

Set leadmail as your mail driver in .env:

MAIL_MAILER=leadmail

Then use Laravel's Mail facade as usual:

Mail::to('user@example.com')->send(new WelcomeMail());

Send Emails via API

LeadMail::sendEmail([
    'from' => ['email' => 'hello@yourdomain.com', 'name' => 'Your App'],
    'to' => [['email' => 'user@example.com', 'name' => 'User']],
    'subject' => 'Welcome!',
    'html_body' => '<h1>Welcome to our app</h1>',
]);

Verify Email Addresses

$result = LeadMail::verifyEmail('user@example.com');

if ($result['data']['valid']) {
    // Email is deliverable
}

Validation Rule

Use the leadmail_verify rule in your form requests:

public function rules(): array
{
    return [
        'email' => ['required', 'email', 'leadmail_verify'],
    ];
}

Get Allowed Sender Domains

$domains = LeadMail::getDomains();
// ['yourdomain.com', 'anotherdomain.com']

Multi-Tenancy

If your app uses stancl/tenancy, the SDK automatically includes the current tenant ID in API requests via the X-Tenant-Id header. Disable this with:

LEADMAIL_AUTO_TENANT=false

License

MIT

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固