$account, 'password' => $password, 'testo' => $testo, 'destinatari' => $destinatari, 'origine' => "nmsms.php " . NMSMS_VERSION ); if( isset($mittente) ) $args['mittente'] = $mittente; if( !empty($opzioni) ) { if( !is_array($opzioni) ) return( 'Il parametro "opzioni" deve essere un Array' ); foreach( $opzioni as $opzione ) { if( strtolower($opzione) == 'bassocosto' ) $args['bassocosto'] = 1; else return( "Opzione \"$opzione\" sconosciuta" ); } } $opts = array( 'http'=>array( 'method' => "POST", 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query( $args ) ) ); $context = stream_context_create( $opts ); $ret = @file_get_contents( 'https://sms.neomedia.it/send', 0, $context ); $ret = rtrim( $ret ); if( $ret == FALSE ) $ret = 'Errore di comunicazione col server SMS'; else if( $ret == 'OK' ) $ret = NULL; else if( preg_match( "/^ERRORE: (.+)$/", $ret, $m ) ) $ret = $m[1]; else $ret = "ERRORE INATTESO: $ret"; return( $ret ); } ?>