#!/usr/local/bin/php

<?php
// remove first argument
array_shift($argv);

if($argv[0] != "" && $argv[1] != ""){
$from = $argv[0];
$file = $argv[1];

	exec("/usr/sbin/sendmail -t -f".$from." -ODeliveryMode=background -oi < ".$file,$error);
	
	if($error[0]){
		echo "error sending voicemail";	
	}else{
		echo "voicemail sent";
	}
}
?>
