The Paubox PHP wrapper allows you to construct and send secure, HIPAA compliant messages. This package is the official PHP wrapper for the Paubox Email API. The Paubox Email API allows your application to send secure, HIPAA compliant email via Paubox and track deliveries and opens. SEE ALSO: Why Healthcare Businesses Choose the Paubox Email API
{ "require": { "paubox/paubox-php": "~1" } }
$ echo "export PAUBOX_API_KEY='YOUR_API_KEY'" > .env $ echo "export PAUBOX_API_USER='YOUR_ENDPOINT_NAME'" >> .env $ source .env $ echo ".env" >> .gitignore
<?php require_once __DIR__ . '/vendor/autoload.php';
$paubox = new Paubox(); $message = new PauboxMailMessage();
$content = new PauboxMailContent(); $content->setPlainText("Hello World"); $header = new PauboxMailHeader(); $header->setSubject("Testing!"); $header->setFrom("sender@domain.com"); $recipients = array(); array_push($recipients,'recipient@example.com'); $message->setHeader($header); $message->setContent($content); $message->setRecipients($recipients); $sendMessageResponse = new PauboxMailSendMessageResponse(); $sendMessageResponse = $paubox->sendMessage($message); print_r($sendMessageResponse);
<?php require_once __DIR__ . '/vendor/autoload.php';
$paubox = new Paubox(); $message = new PauboxMailMessage();
$content = new PauboxMailContent(); $content->setPlainText("Hello World"); $header = new PauboxMailHeader(); $header->setSubject("Testing!"); $header->setFrom("sender@domain.com"); $recipients = array(); array_push($recipients,'recipient@example.com'); $message->setHeader($header); $message->setContent($content); $message->setRecipients($recipients); $message->setAllowNonTLS(true); $sendMessageResponse = new PauboxMailSendMessageResponse(); $sendMessageResponse = $paubox->sendMessage($message); print_r($sendMessageResponse);
<?php require_once __DIR__ . '/vendor/autoload.php';
$paubox = new Paubox(); $message = new PauboxMailMessage();
$content = new PauboxMailContent(); $content->setPlainText("Hello World"); $content->setHtmlText("Hello World"); $header = new PauboxMailHeader(); $header->setSubject("Testing!"); $header->setFrom("sender@domain.com"); $header->setReplyTo("reply_to@domain.com"); $firstAttachment = new PauboxMailAttachment(); $firstAttachment->setFileName("hello_world.txt"); $firstAttachment->setContentType("text/plain"); $firstAttachment->setContent("SGVsbG8gV29ybGQhn"); $secondAttachment = new PauboxMailAttachment(); $secondAttachment->setFileName("hello_world2.txt"); $secondAttachment->setContentType("text/plain"); $secondAttachment->setContent("SGVsbG8gV29ybGQhn"); $attachments = array(); array_push($attachments,$firstAttachment); array_push($attachments,$secondAttachment); $recipients = array(); array_push($recipients,'recipient@example.com'); $bcc = array(); array_push($bcc, 'recipient2@example.com'); $message->setHeader($header); $message->setContent($content); $message->setAttachments($attachments); $message->setRecipients($recipients); $message->setBcc($bcc); $sendMessageResponse = new PauboxMailSendMessageResponse(); $sendMessageResponse = $paubox->sendMessage($message); print_r($sendMessageResponse);
<?php require_once __DIR__ . '/vendor/autoload.php';
$paubox = new Paubox();
$resp = $paubox->getEmailDisposition('SOURCE_TRACKING_ID'); print_r($resp);