まず、このサービスの pear クラスがここにあります
また、別の実装を次に示します。
function dosmsend($number, $message, $flash = "") {
// your aql username and password
$username = "yourusername";
$password = "yourpassword";
$weburl = "http://gw1.aql.com/sms/postmsg.php";
// encodes your message for sending on the web
$message = urlencode($message);
// the request string
$smsurl = "$weburl?username=$username&password=$password&to_num=$number&message=$message";
// if $flash is set to 1, it will add the flash request onto the query
if ($flash == "1")
$smsurl .= "&flash=1";
// connects to server to send message
if ($content_array = file($smsurl)) {
$content = implode("", $content_array);
// check for response
if (eregi("AQSMS-AUTHERROR", $content))
echo "There was an authenication error";
elseif (eregi("AQSMS-NOMSG", $content))
echo "There was no message or mobile number";
elseif (eregi("AQSMS-OK", $content))
echo "The Message was queued succcessfully";
elseif (eregi("AQSMS-NOCREDIT", $content))
echo "Your account has no credit";
}
else
echo "There was an error connecting to the server";
}
dosmsend("09978123456", "this is a test message");
//or
//dosmsend("09978123456","this is a test flash message oo!","1");