Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 140 | All time: 9,211 This week: 140 |
Version | License | PHP version | Categories | |||
dframe-mymail 2.0.0 | Custom (specified... | 7 | Email, PHP 5 |
Description | Author | |
This package can compose and send email messages using PHPMailer. |
<?php |
Simple mail wrapper using phpmailer
$ composer require dframe/mymail
use \Dframe\MyMail\MyMail;
require_once __DIR__ . '/../vendor/autoload.php';
$config = require_once 'config/config.php';
$MyMail = new MyMail($config); // Load Config
$addAddress = ['mail' => 'adres@email', 'name' => 'Title From']; // Addresses to send
$MyMail->send($addAddress, 'Test Mail', $body);
<?php
use Dframe\MyMail\MyMail;
require_once __DIR__ . '/../vendor/autoload.php';
$config = require_once 'config/config.php';
$MyMail = new MyMail($config); // Za?adowanie Configu
$MyMail->mail->isSMTP();
$MyMail->mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
//$MyMail->SMTPDebug = 2; // Enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$MyMail->mail->SMTPSecure = false;
$addAddress = ['mail' => 'adres@email', 'name' => 'titleFrom']; // Addresses to send
try {
$MyMail->send($addAddress, 'Test Mail', 'Hello Word!');
} catch (Exception $e) {
echo $e->getMessage();
}
<?php
use Dframe\MyMail\MyMail;
use Dframe\Component\Config\Config;
$view = $this->loadView('index');
$MyMail = new MyMail(Config::load('myMail')->get()); // Load Configu
/*
* If you have problem with ssl in php 5.6 add
* $MyMail->SMTPOptions = [
* 'ssl' => [
* 'verify_peer' => false,
* 'verify_peer_name' => false,
* 'allow_self_signed' => true
* ]
* ];
*/
$MyMail->SMTPDebug = 2; // Enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$addAddress = ['mail' => $_POST['email'], 'name' => $_POST['firstname']]; // Addresses to send
$view->assign('name', $_POST['firstname']); // Assign template values
$body = $view->fetch('reset'); // Template mail
$MyMail->send($addAddress, 'Test Mail', $body);
Files (17) |
File | Role | Description | ||
---|---|---|---|---|
examples (2 directories) | ||||
src (1 file) | ||||
tests (2 files) | ||||
.travis.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
MIGRATION_1.1_to_2.0.md | Example | Example script | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Read me |
Files (17) | / | examples |
Files (17) | / | examples | / | example1 |
Files (17) | / | examples | / | example2 |
File | Role | Description | ||
---|---|---|---|---|
app (4 directories) | ||||
tables.sql | Data | Auxiliary data |
Files (17) | / | examples | / | example2 | / | app |
File | Role | Description | ||
---|---|---|---|---|
bin (1 file) | ||||
Config (1 file) | ||||
Controller (1 file) | ||||
Model (2 files) |
Files (17) | / | examples | / | example2 | / | app | / | Config |
File | Role | Description |
---|---|---|
myMail.php | Aux. | Auxiliary script |
Files (17) | / | examples | / | example2 | / | app | / | Controller |
File | Role | Description |
---|---|---|
Mail.php | Class | Class source |
Files (17) | / | examples | / | example2 | / | app | / | Model |
Files (17) | / | tests |
File | Role | Description |
---|---|---|
Bootstrap.php | Aux. | Auxiliary script |
SetupTest.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.