PHP Classes

File: examples/example1/index.php

Recommend this page to a friend!
  Classes of Slawomir Kaleta   Dframe MyMail   examples/example1/index.php   Download  
File: examples/example1/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Dframe MyMail
Compose and send email messages using PHPMailer
Author: By
Last change: Resolved #4, Update To PHPMailer 6.x
Date: 3 years ago
Size: 751 bytes
 

Contents

Class file image Download
<?php

use Dframe\MyMail\MyMail;

require_once
__DIR__ . '/../vendor/autoload.php';
$config = include_once 'config/config.php';

$mail = new MyMail($config); // Za?adowanie Configu
$mail->mailObject->isSMTP();
$mail->mailObject->SMTPOptions = [
   
'ssl' => [
       
'verify_peer' => false,
       
'verify_peer_name' => false,
       
'allow_self_signed' => true
   
]
];
//$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->mailObject->SMTPSecure = false;

$addAddress = ['mail' => 'adres@email', 'name' => 'Title From']; // Adresy na jakie ma wys?a?

try {
   
$mail->send($addAddress, 'Test Mail', 'Hello Word!');
} catch (
Exception $e) {
    echo
$e->getMessage();
}