承接 codeqasim/mailer 相关项目开发

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

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

codeqasim/mailer

最新稳定版本:1.0

Composer 安装命令:

composer require codeqasim/mailer

包简介

A professional PHP email library.

README 文档

README

CodeQasim Mailer is a lightweight, professional PHP library for sending emails via SMTP. It supports templated emails with variable placeholders, attachments, and secure authentication (TLS/SSL). Built for simplicity and flexibility, this library is perfect for developers who need an efficient and customizable mailer solution.

Features

  • SMTP Support: Send emails using secure SMTP configurations.
  • Templated Emails: Use .html templates with placeholders (e.g., {name}, {date}).
  • Secure Authentication: Supports TLS and SSL encryption.
  • PSR-4 Autoloading: Easy integration with Composer.
  • Customizable: Flexible email headers, body, and configurations.

Installation

Install the library using Composer:

composer require codeqasim/mailer

Usage

Configuration

Set up the mailer with your SMTP server details:

require 'vendor/autoload.php';

use CodeQasim\Mailer\Mailer;

$mailer = new Mailer();

$mailer->configure([
    'server' => 'smtp.gmail.com',
    'port' => 587,
    'security' => 'tls', // 'tls' or 'ssl'
    'username' => 'your_email@gmail.com',
    'password' => 'your_email_password',
]);

Sending an Email

Send an email using an HTML template and variable placeholders:

$mailer->sendEmail([
    'from' => 'your_email@gmail.com',
    'to' => 'recipient@example.com',
    'subject' => 'Test Email',
    'template' => 'path/to/template.html', // Path to your template
    'variables' => [ // Variables for placeholders in the template
        'name' => 'John Doe',
        'date' => date('Y-m-d'),
    ],
]);

Example HTML Template

Create a .html file for your email template:

<!DOCTYPE html>
<html>
<head>
    <title>{subject}</title>
</head>
<body>
    <p>Dear {name},</p>
    <p>This is a test email sent on {date}.</p>
</body>
</html>

License

This library is licensed under the MIT License. See the LICENSE file for more details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request to contribute.

Support

For support or questions, feel free to contact us at compoxition@gmail.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-16