コード例 #1
0
 public function transmitAction()
 {
     $efax = new eFaxOutbound();
     $data = array();
     $efax->setTransmissionId('10001');
     //$efax->setDispositionMethod('POST');
     //$efax->setDispositionUrl('https://ec2-67-202-27-183.compute-1.amazonaws.com/efax.raw/inbound');
     $efax->setDispositionMethod('EMAIL');
     $efax->addDispositionEmail('Arthur Layese', '*****@*****.**');
     $efax->addRecipient('6022976632', 'Jay Walker', 'ClearHealth Inc.');
     $fileTypes = array('doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'html', 'htm', 'tif', 'tiff', 'jpg', 'jpeg', 'txt', 'pdf', 'rtf', 'snp', 'png', 'gif');
     $basePath = Zend_Registry::get('basePath');
     $filename = $basePath . 'Sample.tif';
     $fileType = pathinfo($filename, PATHINFO_EXTENSION);
     if (!in_array($fileType, $fileTypes)) {
         return false;
     }
     $contents = file_get_contents($filename);
     $efax->addFile(base64_encode($contents), $fileType);
     $ret = $efax->transmit();
     print_r($ret);
     die;
 }