znframework/package-email

ZN Framework Email Package

8.10.0 2024-04-12 18:38 UTC

This package is auto-updated.

Last update: 2024-04-12 18:39:21 UTC


README

68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a6e6672616d65776f726b2f7061636b6167652d656d61696c3f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7a6e6672616d65776f726b2f7061636b6167652d656d61696c3f7374796c653d666c61742d73717561726526636f6c6f723d303042464646 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f7a6e6672616d65776f726b2f7061636b6167652d656d61696c3f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7a6e6672616d65776f726b2f7061636b6167652d656d61696c3f7374796c653d666c61742d737175617265

ZN Framework Email Package

Follow the steps below for installation and use.

Installation

You only need to run the following code for the installation.

composer require znframework/package-email

Documentation

Click for documentation of your library.

Example Usage

Basic level usage is shown below.

<?php require 'vendor/autoload.php';

ZN\ZN::run();

# The default settings are in the ZN\Email\EmailDefaultConfiguration file. 
# You can make your settings in this file.
# The Config::set() method should be used if you need to configure settings externally.
Config::services('email', 
[
    'driver' => 'smtp',
    'smtp'   =>
    [
        'host'      => '',
        'user'      => '',
        'password'  => '',
        'port'      => 587,
        'keepAlive' => false,
        'timeout'   => 10,
        'encode'    => '',  # empty, tls, ssl
        'dsn'       => false,
        'auth'      => true
    ],
    'general' =>
    [
        'senderMail'    => '',                  # Default Sender E-mail Address.
        'senderName'    => '',                  # Default Sender Name.
        'priority'      => 3,                   # 1, 2, 3, 4, 5
        'charset'       => 'UTF-8',             # Charset Type
        'contentType'   => 'html',              # plain, html
        'multiPart'     => 'mixed',             # mixed, related, alternative
        'xMailer'       => 'ZN',
        'encoding'      => '8bit',              # 8bit, 7bit
        'mimeVersion'   => '1.0',               # MIME Version
        'mailPath'      => '/usr/sbin/sendmail' # Default Mail Path
    ]
]);

Email::from('from@example.com')
     ->to('to@example.com')
     ->send('This is Subject', 'This is message.');

Output::display(Email::error());