1. Go to this page and download the library: Download omarpre/paubox library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
omarpre / paubox example snippets
env = Dotenv\Dotenv::create(__DIR__);
$dotenv->load();
$paubox = new Paubox\Paubox();
$message = new Paubox\Mail\Message();
$content = new Paubox\Mail\Content();
$content->setPlainText("Hello World");
$header = new Paubox\Mail\Header();
$header->setSubject("Testing!");
$header->setFrom("[email protected]");
$recipients = array();
array_push($recipients,'[email protected]');
$message->setHeader($header);
$message->setContent($content);
$message->setRecipients($recipients);
$sendMessageResponse = new Paubox\Mail\SendMessageResponse();
$sendMessageResponse = $paubox->sendMessage($message);
print_r($sendMessageResponse);
env = Dotenv\Dotenv::create(__DIR__);
$dotenv->load();
$paubox = new Paubox\Paubox();
$message = new Paubox\Mail\Message();
$content = new Paubox\Mail\Content();
$content->setPlainText("Hello World");
$header = new Paubox\Mail\Header();
$header->setSubject("Testing!");
$header->setFrom("[email protected]");
$recipients = array();
array_push($recipients,'[email protected]');
$message->setHeader($header);
$message->setContent($content);
$message->setRecipients($recipients);
$message->setAllowNonTLS(true);
$sendMessageResponse = new Paubox\Mail\SendMessageResponse();
$sendMessageResponse = $paubox->sendMessage($message);
print_r($sendMessageResponse);
env = Dotenv\Dotenv::create(__DIR__);
$dotenv->load();
$paubox = new Paubox\Paubox();
$message = new Paubox\Mail\Message();
$content = new Paubox\Mail\Content();
$content->setPlainText("Hello World");
$header = new Paubox\Mail\Header();
$header->setSubject("Testing!");
$header->setFrom("[email protected]");
$recipients = array();
array_push($recipients,'[email protected]');
$message->setHeader($header);
$message->setContent($content);
$message->setRecipients($recipients);
$message->setForceSecureNotification("true");
$sendMessageResponse = new Paubox\Mail\SendMessageResponse();
$sendMessageResponse = $paubox->sendMessage($message);
print_r($sendMessageResponse);