Installation

Requirements

RequirementVersion
PHP^8.0
WordPress5.9+
wpzylos-core^1.0

Install via Composer

composer require KYNetCode/wpzylos-mail

Register the ServiceProvider

Add MailServiceProvider to your plugin's service provider list:

use WPZylos\Framework\Mail\MailServiceProvider;

// In your plugin bootstrap or Application setup
$app->register(new MailServiceProvider());

This registers:

  • MailManager::class — as a singleton in the container
  • 'mail' — as an alias pointing to the same MailManager instance

Verify Installation

// Resolve from the container
$mailManager = $app->make(MailManager::class);
// or via alias
$mailManager = $app->make('mail');

// Send a test email
$mailManager->to('[email protected]')
    ->subject('WPZylos Mail Test')
    ->line('If you received this, the mail package is working!')
    ->send();

SMTP Configuration

WPZylos Mail uses wp_mail() under the hood, so any SMTP plugin will work:

Install and configure your preferred SMTP plugin — no additional configuration is needed in WPZylos Mail.