<?php

require_once 'phaxio_config.php';
require_once 'autoload.php';
use Phaxio\Phaxio;
$phaxio = new Phaxio($apiKeys[$apiMode], $apiSecrets[$apiMode], $apiHost);
$result = $phaxio->sendFax($toNumber, array(), array('callback_url' => $customCallback, 'string_data' => $textData, 'string_data_type' => 'text'));
var_dump($result);
<?php

require_once 'phaxio_config.php';
require_once 'autoload.php';
use Phaxio\Phaxio;
$phaxio = new Phaxio($apiKeys[$apiMode], $apiSecrets[$apiMode], $apiHost);
$result = $phaxio->sendFax($toNumber, array(), array('string_data' => $htmlData, 'string_data_type' => 'html'));
var_dump($result);
<?php

require_once 'phaxio_config.php';
require_once 'autoload.php';
use Phaxio\Phaxio;
$phaxio = new Phaxio($apiKeys[$apiMode], $apiSecrets[$apiMode], $apiHost);
echo "Creating a 3 part batch with a one minute delay...\n";
for ($i = 1; $i <= 3; $i++) {
    $result = $phaxio->sendFax($toNumber, array(), array('string_data' => "This is part {$i} of a 3 part fax batch.  This is the first batch.", 'string_data_type' => 'text', 'batch' => true, 'batch_delay' => 60));
    var_dump($result);
    echo "Part {$i} of 3 sent.  Sleeping for 5 seconds...\n";
    sleep(5);
}
echo "First batch created successfully.  Sleeping for 45 seconds and creating a new batch.  First batch will start to send. \n\n";
sleep(45);
echo "Creating a 3 part batch with a one minute delay...\n";
for ($i = 1; $i <= 3; $i++) {
    $result = $phaxio->sendFax($toNumber, array(), array('string_data' => "This is part {$i} of a 3 part fax batch.  This is the second batch.", 'string_data_type' => 'text', 'batch' => true, 'batch_delay' => 60));
    var_dump($result);
    echo "Part {$i} of 3 sent.  Sleeping for 5 seconds...";
    sleep(5);
}
echo "Done.";
Example #4
0
<?php

require_once 'phaxio_config.php';
require_once 'autoload.php';
use Phaxio\Phaxio;
# Create files and put their names here
$files = array('files/coverPage.html', 'files/content.pdf');
$phaxio = new Phaxio($apiKeys[$apiMode], $apiSecrets[$apiMode], $apiHost);
$result = $phaxio->sendFax($toNumber, $files);
var_dump($result);
<?php

require_once 'phaxio_config.php';
require_once 'autoload.php';
use Phaxio\Phaxio;
$phaxio = new Phaxio($apiKeys[$apiMode], $apiSecrets[$apiMode], $apiHost);
for ($i = 1; $i <= 5; $i++) {
    $result = $phaxio->sendFax($toNumber, array(), array('string_data' => "This is part {$i} of a 5 part fax batch.", 'string_data_type' => 'text', 'batch' => true));
    var_dump($result);
}
echo "Your batch has been created for {$toNumber}.  You can now see it in the Phaxio web UI.  To fire it, see fireBatch.php";