PHPackages                             pardnchiu/mailer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. pardnchiu/mailer

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

pardnchiu/mailer
================

Lightweight PHP mailer client supporting SMTP sending, automatic configuration management, and complete email functionality. Built on PHPMailer, providing stable and reliable email sending experience.

v1.0.0(8mo ago)02MITPHPPHP &gt;=8.0

Since Aug 24Pushed 8mo agoCompare

[ Source](https://github.com/pardnchiu/php-mailer)[ Packagist](https://packagist.org/packages/pardnchiu/mailer)[ Docs](https://pardn.io)[ RSS](/packages/pardnchiu-mailer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

PHP Mailer
==========

[](#php-mailer)

> Lightweight PHP mail client with SMTP support, automatic configuration management, and complete email functionality.
> Built on PHPMailer, providing stable and reliable email delivery experience.

[![packagist](https://camo.githubusercontent.com/07ead88b55b1e14fbc4152b53aca40fae8d55a5b844a341272863f3939fe03f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706172646e636869752f6d61696c6572)](https://packagist.org/packages/pardnchiu/mailer)[![version](https://camo.githubusercontent.com/f3923f4ab961404df3fce47ca080ab732168d8fbe607503b05d0ed6e3e530c71/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f706172646e636869752f7068702d6d61696c65723f6c6162656c3d72656c65617365)](https://github.com/pardnchiu/php-mailer/releases)[![license](https://camo.githubusercontent.com/96ce46fab74bbdc123cee1c3fe13846bd400df0bb13ef26db82fbf7959ecb93b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706172646e636869752f7068702d6d61696c6572)](LICENSE)
[![readme](https://camo.githubusercontent.com/d5091ba395eb4366212f9eba6aeb8e100943733ce395d8fe1670fa047718d214/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f726561646d652d454e2d7768697465)](README.md)[![readme](https://camo.githubusercontent.com/791b697cc57e33a15418cccce06933680ce6a7a4634d3657498fb3a62e573af9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f726561646d652d5a482d7768697465)](README.zh.md)

- [Three Core Features](#three-core-features)
    - [Automatic Configuration Management](#automatic-configuration-management)
    - [Bulk Sending Support](#bulk-sending-support)
    - [Stable Connection](#stable-connection)
- [Features](#features)
- [Usage](#usage)
    - [Installation](#installation)
    - [Environment Variables Setup](#environment-variables-setup)
    - [Basic Usage](#basic-usage)
- [API Reference](#api-reference)
    - [Basic Sending](#basic-sending)
    - [Bulk Sending](#bulk-sending)
- [Error Handling](#error-handling)
- [License](#license)
- [Author](#author)

Three Core Features
-------------------

[](#three-core-features)

### Automatic Configuration Management

[](#automatic-configuration-management)

Automatically configure connection parameters based on environment variables, supporting multiple SMTP services

### Bulk Sending Support

[](#bulk-sending-support)

Support bulk email sending functionality, suitable for system notifications and high-volume sending needs

### Stable Connection

[](#stable-connection)

Built-in error handling and automatic cleanup mechanisms to ensure reliable email delivery

Features
--------

[](#features)

- **Environment Variable Configuration**: Flexible environment variable setup supporting multi-environment deployment
- **SMTP Support**: Support for multiple SMTP services with automatic encryption configuration
- **HTML/Plain Text**: Support for both HTML and plain text email formats
- **Multiple Recipients**: Support for multiple recipients, CC, and BCC
- **Priority Settings**: Support for high, normal, and low priority email sending
- **Bulk Sending**: Built-in bulk sending functionality for improved sending efficiency
- **Automatic Cleanup**: Automatic cleanup of recipient lists after sending

Usage
-----

[](#usage)

### Installation

[](#installation)

```
composer require pardnchiu/mailer
```

### Environment Variables Setup

[](#environment-variables-setup)

```
MAIL_SERVICE=smtp.gmail.com          # SMTP server
MAIL_SERVICE_USER=your@email.com     # Sender account
MAIL_SERVICE_PASSWORD=your_password  # Password or app password
MAIL_SERVICE_PORT=587                # SMTP port (465/587/25)
MAIL_SERVICE_CHARSET=UTF-8           # Character encoding
```

### Basic Usage

[](#basic-usage)

**Method 1: Static Call (Recommended)**

```
