rubricate/mailer 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

rubricate/mailer

最新稳定版本:v1.1.0

Composer 安装命令:

composer require rubricate/mailer

包简介

Component for sending emails via authenticated SMTP. It works on remote servers with support for sockets (fsockopen) and TLS.

README 文档

README

Maintainer Source Code PHP from Packagist Latest Version Software License Total Downloads

Last Version

$ composer require rubricate/mailer

Documentation is at https://rubricate.github.io/components/mailer

Requirements

  • PHP server with sockets and TLS/SSL support

Check if your PHP server supports sockets and TLS/SSL:

1. Sockets support in PHP

If sockets appears, support is enabled.

php -m | grep sockets

or code:

if (extension_loaded('sockets')) {
    echo "Sockets extension is enabled.";
} else {
    echo "Sockets extension is NOT enabled.";
}

2. TLS/SSL support (via OpenSSL)

TLS is supported via the openssl extension. This extension is used for secure connections (SMTP with TLS/SSL, HTTPS, etc.).

php -m | grep openssl

or via code:

if (extension_loaded('openssl')) {
    echo "OpenSSL is enabled (TLS/SSL support)";
} else {
    echo "OpenSSL is NOT enabled";
}

Usage example

$mailer = new SmtpMailer(
    'smtp.gmail.com', // Host
    587, // Port
    'yourmail@gmail.com', // User
    'your_password_or_appkey', // Password or App Password
    'yourmail@gmail.com', // Sender
    'Your Name', // Sender's Name
    true // Enable debugging
);

try {
    $mailer->send(
        'destination@example.com', // Recipient
        'Pure SMTP email test', // Subject
        '<h1>Working!</h1><p>This is a test via Rubricate Mailer.</p>', // Body
        true // Send as HTML
    );

    echo "Email sent successfully!";

} catch (Exception $e) {
    echo "Error sending: " . $e->getMessage(); 
}

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

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