Dframe MyMail: Compose and send email messages using PHPMailer

Recommend this page to a friend!
  Info   View files Example   View files View files (17)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-09-12 (Yesterday) RSS 2.0 feedNot yet rated by the usersTotal: 110 This week: 17All time: 9,287 This week: 18Up
Version License PHP version Categories
dframe-mymail 2.0.0Custom (specified...7Email, PHP 5
Description Author

This package can compose and send email messages using PHPMailer.

It is a simple wrapper around that the PHPMailer library with a function that can send the whole message in a single call.

The class also supports adding one or more files to be attached to the message.

Picture of Slawomir Kaleta
  Performance   Level  
Name: Slawomir Kaleta <contact>
Classes: 8 packages by
Country: Poland Poland

Details

Dframe/MyMail

Build Status Latest Stable Version Latest Unstable Version License

Simple mail wrapper using phpmailer

Composer

$ composer require dframe/mymail

Usage

Standalone example#1 php

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);

Standalone example#2 php

<?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();
	
}

Example #1 with Dframe Framework

config/myMail.php - here

<?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 folder image Files  
File Role Description
Files folder imageexamples (2 directories)
Files folder imagesrc (1 file)
Files folder imagetests (2 files)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file MIGRATION_1.1_to_2.0.md Example Example script
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Read me

  Files folder image Files  /  examples  
File Role Description
Files folder imageexample1 (1 file, 1 directory)
Files folder imageexample2 (1 file, 1 directory)

  Files folder image Files  /  examples  /  example1  
File Role Description
Files folder imageconfig (1 file)
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  examples  /  example1  /  config  
File Role Description
  Accessible without login Plain text file myMail.php Aux. Auxiliary script

  Files folder image Files  /  examples  /  example2  
File Role Description
Files folder imageapp (4 directories)
  Accessible without login Plain text file tables.sql Data Auxiliary data

  Files folder image Files  /  examples  /  example2  /  app  
File Role Description
Files folder imagebin (1 file)
Files folder imageConfig (1 file)
Files folder imageController (1 file)
Files folder imageModel (2 files)

  Files folder image Files  /  examples  /  example2  /  app  /  bin  
File Role Description
  Plain text file CronSmall.php Class Class source

  Files folder image Files  /  examples  /  example2  /  app  /  Config  
File Role Description
  Accessible without login Plain text file myMail.php Aux. Auxiliary script

  Files folder image Files  /  examples  /  example2  /  app  /  Controller  
File Role Description
  Plain text file Mail.php Class Class source

  Files folder image Files  /  examples  /  example2  /  app  /  Model  
File Role Description
  Plain text file Mail.php Class Class source
  Plain text file Model.php Class Class source

  Files folder image Files  /  src  
File Role Description
  Plain text file MyMail.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Accessible without login Plain text file Bootstrap.php Aux. Auxiliary script
  Plain text file SetupTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:110
This week:17
All time:9,287
This week:18Up

For more information send a message to info at phpclasses dot org.