Esempio n. 1
0
<?php

use Qwant\Config;
$loader = (require __DIR__ . '/vendor/autoload.php');
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
//  Reads all files .php | .ini | .yaml from folder
$config = new Config(__DIR__ . '/src/configs');
var_dump($config->getData());
Esempio n. 2
0
<?php

/**
 *  Skeleton application
 */
use Qwant\Config;
use Qwant\Mailer;
use Qwant\Message;
error_reporting(E_ALL);
ini_set('display_errors', 1);
$loader = (require __DIR__ . '/vendor/autoload.php');
$conf = new Config(__DIR__ . '/src/configs/');
// Create a new message
$message = new Message();
// This is optional headers for example only
$message->addHeader('Error-to', '*****@*****.**')->addHeader('Subject', 'Must to WORK!')->addHeader('From', '*****@*****.**')->addHeader('Content-Type', 'text/plain; charset=UTF-8')->setBody('Content-Type and charset added.')->setMailTo('*****@*****.**');
// mailTo MUST!
// Use information about the transport from a config file
$mailer = new Mailer($conf->getData('mailer'));
if ($mailer->send($message)) {
    echo 'Success';
    // Success
} else {
    // Error
}