FaxMate PHP API
FAX - Plain Text
The following example is for sending text. The contents from $From, $Subject and $body will be converted into a 1(or more) page document.
Example:
<?PHP
$To = '
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
'; // fax number you wish to send to / or FAXMATE Email address
$From = '
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
'; // from your FAXMATE registered email address
$Subject = 'FAX from PHP Text Script';
$body = "Hello World";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: <$From>" . "\r\n";mail($To, $Subject,
$body, $headers); echo("Mail Sent: FAX from PHP Text Script"); // remove if you wish ?>
FAX – Plain Text with Attachments
The following example is for sending FAX’s with attachments. The preferred formats that work best are .PDF and .DOC (.TIF and .JPG do also work but do not render as better as the 2 preferred formats)
To send attachments you will need to download and use a PHP Library – LibMail There is detailed documentation about LibMail at this address, but we have an example below. ( download - http://lwest.free.fr/doc/php/lib/index.php3?page=mail&lang=en ) Once you have downloaded add the Libmail folder into your working folder, the first line of code will include this library set, see Example.
Example
<?PHP
include "libmail/libmail.php"; // include the Libmail library
$m = new Mail(); // create the mail
$m->From("xx xx <
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
'>"); // from your FAXMATE registered email address
$m->To("'
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
'"); // fax number you wish to send to / or FAXMATE Email address
$m->Subject( "Mail Sent test - DOC" );
$m->Body( "Hello World with Attachment" );
$m->Priority(4);
// Attach document – in this case a PDF
// Uncomment other file types if you wish to use. You can use more than one at once.
$m->Attach("xx.pdf", "application/pdf", "inline" );
// $m->Attach("xx.doc", "application/msword", "inline" );
// $m->Attach("xx.jpg", "image/jpeg", "inline" );
// $m->Attach("xx.tiff", "image/tiff", "inline" );
$m->Send(); // send the mail
echo("Mail Sent: FAX from PHP Text Script with Attachment"); // remove if you wish ?> 


