effectra/mail 问题修复 & 功能扩展

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

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

effectra/mail

最新稳定版本:v2.1.0

Composer 安装命令:

composer require effectra/mail

包简介

The Effectra Mail package.

README 文档

README

Effectra\Mail is a package that provides a flexible and easy-to-use email sending functionality for your applications. It supports multiple mail drivers and allows you to configure various email settings such as the mail server host, port, authentication, and more.

Features

  • Support for multiple mail drivers (SMTP, sendmail, etc.)
  • Configuration options for mail server settings
  • Easy setup and usage
  • Exception handling for mail sending errors

Installation

You can install the Effectra\Mail package via Composer. Run the following command in your terminal:

composer require effectra/mail

Usage

Creating a Mailer Instance

To send emails using the Effectra\Mail package, you need to create a mailer instance. The MailerFactory class provides a convenient way to create the mailer instance:

use Effectra\Mail\Mailer;

// Create a mailer instance
$mailer = new Mailer(
    'smtp',         // Mail driver (e.g., 'smtp', 'sendmail')
    'mail.example.com',  // Mail server host
    587,            // Mail server port
    'username',     // Username for authentication
    'password',     // Password for authentication
    'info@example.com'  // "From" email address
);

Sending an Email

Once you have a mailer instance, you can use it to send emails. The Mailer class provides methods for setting the email recipients, subject, content, and more. Here's an example of sending an email:

$mail = new Mail();
// Set email recipients
$mail->to('recipient1@example.com');
$mail->cc('recipient2@example.com');
$mail->bcc('recipient3@example.com');

// Set email subject and content
$mail->subject('Hello, world!');
$mail->text('This is the plain text content of the email.');
$mail->html('<p>This is the HTML content of the email.</p>');

// Send the email
try {
    $mailer->send($mail);
    echo 'Email sent successfully!';
} catch (Exception $e) {
    echo 'An error occurred while sending the email: ' . $e->getMessage();
}

Feel free to explore the Mailer class and its methods to customize the email sending process according to your needs.

License

This package is open-source software licensed under the MIT license.

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please create an issue or submit a pull request on the GitHub repository.

Credits

Effectra\Mail is developed and maintained by Mohammed Taha.

Support

For any questions or support regarding the Effectra\Mail package, please contact support@example.com.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-19