<?php
require_once('nusoap.php');
$username = "";
$password = "";
$faxnumber = ""; // formatted like +13055551234,
// i.e. +(country code)(area code)(phone number)
$file = ""; // binary file to fax
$filetype = ""; // e.g. HTML, DOC, PDF, etc.; see
// documentation for complete list
$postponetime = ""; // e.g. 2001-04-25T20:31:00-04:00,
// use a past date/time to fax immediately
$resolution = ""; // 0 for standard, 1 for fine
$csid = ""; // your fax identifier, visible on
// the receiving machine's little screen
$subject = ""; // for your reference, visible in the outbound queue
$replyemail = ""; // optional address at which to receive an
// emailed confirmation
// Open File
if( !($fp = fopen($file, "r")))
{
// Error opening file
// Handle error how it is appropriate for your script
exit;
}
// Read data from the file into $data
$data = "";
while (!feof($fp)) $data .= fread($fp,1024);
$client = new soapclient("http://ws.interfax.net/dfs.asmx?wsdl", true);
$params[] = array('Username' => $username,
'Password' => $password,
'FaxNumbers' => $faxnumber,
'FilesData' => base64_encode($data),
'FileTypes' => $filetype,
'FileSizes' => strlen($data),
'Postpone' => $postponetime,
'IsHighResolution' => $resolution,
'CSID' => $csid,
'Subject' => $subject,
'ReplyAddress' => $replyemail
);
$result = $client->call("SendfaxEx", $params);
echo $result["SendfaxExResult"];
?>