thedavidinyang/phpsimplemail
Composer 安装命令:
composer require thedavidinyang/phpsimplemail
包简介
A full-featured simple php fluent interface for sending html or plaintext emails via smtp
README 文档
README
A full-featured simple php fluent interface for sending html or plaintext emails via smtp or sendgrid
<?php $e = new Mailer; $setup = ['host' => '', 'username'=>'', 'password'=>'', 'authentication'=>'', 'port'=>'' ]; $e->init('smtp') ->setup($setup) ->subject('Welcome') ->to(['name' => 'David Inyang', 'email'=>'samplemail@gmail.com']) ->from(['name' => 'David Inyang', 'email'=>'samplemail@gmail.com']) ->body('Hi, welcome to the team') ->sendmail();
This is a simple mail interface that makes sending smtp emails extremely easy.
You can send plaintext or html email, and also include attatchements easily from a fluent interface.
It provides all the basic pieces need to craft almost any kind of email.
SMTP Configuration
- host = smtp host url
- username = smtp username
- password = smtp password
- authentication = SSL or TLS
- port = smtp port
Sendgrid Configuration
- apiKey = your sendgrid api key
Easy Installation
Install with composer
To install with Composer, simply require the latest version of this package.
composer require thedavidinyang/phpsimplemail
Make sure that the autoload file from Composer is loaded.
// somewhere early in your project's loading, require the Composer autoloader // see: http://getcomposer.org/doc/00-intro.md require 'vendor/autoload.php';
Download and install
Download a packaged archive and extract it into the directory where the package will reside
- You can download stable copies of dompdf from https://github.com/thedavidinyang/phpsimplemail/releases
Quick Start
Just pass your email configuration into PHPSimplemail:
// reference the SimpleMail namespace use thedavidinyang\SimpleMail\Mailer; // Setup SMTP Configurations $setup = ['host' => '', 'username'=>'', 'password'=>'', 'authentication'=>'', 'port'=>'' ]; // initialize and use the SimpleMail class $e = new Mailer; $e->init('smtp') ->setup($setup) // Set mail parameters // Subject ->subject('Welcome') // Recipient ->to(['name' => 'David Inyang', 'email'=>'samplemail@gmail.com']) // Sender ->from(['name' => 'David Inyang', 'email'=>'samplemail@gmail.com']) // Content ->body('Hi, welcome to the team') // Send mail ->sendmail();
SendGrid Integration
Just pass your sendgrid API key into PHPSimplemail:
// reference the SimpleMail namespace use thedavidinyang\SimpleMail\Mailer; // Setup SMTP Configurations $setup = ['apiKey' => '' ]; // initialize and use the SimpleMail class $e = new Mailer; $e->init('sendgrid') ->setup($setup) // Set mail parameters // Subject ->subject('Welcome') // Recipient ->to(['name' => 'David Inyang', 'email'=>'samplemail@gmail.com']) // Sender ->from(['name' => 'David Inyang', 'email'=>'samplemail@gmail.com']) // Content ->body('Hi, welcome to the team') // Send mail ->sendmail();
thedavidinyang/phpsimplemail 适用场景与选型建议
thedavidinyang/phpsimplemail 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 01 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「mail」 「php」 「smtp」 「phpmailer」 「simple mail」 「php email」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 thedavidinyang/phpsimplemail 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 thedavidinyang/phpsimplemail 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 thedavidinyang/phpsimplemail 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Courier offers a convenient and painless solution for creating emails tailored for your Kirby website.
Mail libraries used by Zimbra Api
The Message Submission Agent Diagnostics tool (msadiag) facilitates testing the compatibility of third party message submission agents.
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
PHPMailer helper class for sending emails using SMTP
An extension to Koldy Framework that brings integration for PHPMailer
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-10