Send email across all platforms using one interface.
Table Of Content
- To
- From
- CC
- BCC
- Reply to
- Subject
- Text Body
- HTML Body
- Attachements
Requirements
This library uses PHP 5.5+.
Installation
It is recommended that you install the Omnimail library through composer. To do so, run the Composer command to install the latest stable version of Omnimail library.
composer require omnimail/omnimail
Providers
AmazonSES
Installation
To use the AmazonSES sender class, you will need to install the daniel-zahariev/php-aws-ses
library using composer.
composer require daniel-zahariev/php-aws-ses
Usage
use Omnimail\Email;
use Omnimail\AmazonSES;
$sender = new AmazonSES($accessKey, $secretKey);
$email = (new Email())
->addTo('[email protected]')
->setFrom('[email protected]')
->setSubject('Hello, world!')
->setTextBody('Hello World!\n\nHow are you?');
$sender->send($email);
Mailgun
Installation
To use the Mailgun sender class, you will need to install the mailgun/mailgun-php
library using composer.
composer require mailgun/mailgun-php
Usage
use Omnimail\Email;
use Omnimail\Mailgun;
$sender = new Mailgun($apiKey, $domain);
$email = (new Email())
->addTo('[email protected]')
->setFrom('[email protected]')
->setSubject('Hello, world!')
->setTextBody('Hello World!\n\nHow are you?');
$sender->send($email);
License
Omnimail is licensed under The MIT License (MIT).