Avis sur qFreeFax
Petitadam
Messages postés
1159
Statut
Contributeur
-
titeuf -
titeuf -
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.
https://www.commentcamarche.net/download/telecharger-34055650-qfreefax
https://www.commentcamarche.net/download/telecharger-34055650-qfreefax
-
-
Bonjour,
Ci-dessous le source en PHP qui permet d'envoyer un fax au format texte via le service
fax de chez Free.
Attention aux nombres de fax autorisés : 10 par jour.
Utiliser la fonction principale suivante
envoyer_fax ($msg, $login, $password, $destinataire, $email_ack)
avec comme paramètres :
$msg = message texte
$login = votre identifiant Free
$password = votre mot de passe chez Free
$destinataire = numéro de fax du destinataire
$email_ack = 0 ou 1 pour avoir un accusé d'émission sur son mail
<?php
$timeout = 10;
///////////////////////////////////////////////////////////////////////////////////
function obtenir_id_idt($page, &$id, &$idt)
{
//<p>The document has moved <a href="https://subscribe.free.fr/login/?error=2">here</a>.</p>
$chaine_recherchee = "<a href=";
$debut_id = strstr($page,"?id=");
$fin_id = strpos ($debut_id, "&");
$id = substr ($debut_id, 4, $fin_id -4);
$debut_idt = strstr($debut_id,"idt=");
$fin_idt = strpos ($debut_idt, chr(34));
$idt = substr ($debut_idt, 4, $fin_idt -4);
}
///////////////////////////////////////////////////////////////////////////////////
function connecter_fax ( $id, $idt)
{
$fax_url = "https://adsl.free.fr/tel_fax.pl";
$ch = curl_init(); // création d'une nouvelle ressource CURL
// configuration de l'URL et d'autres options
curl_setopt($ch, CURLOPT_URL, $fax_url);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'id' => $id,
'idt' => $idt ));
$page = curl_exec($ch); // récupération du contenu de la page
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch); // fermeture de la session curl
$trace_file = __DIR__."/connecter_fax.txt";
$hd = fopen($trace_file,"w+");
fwrite($hd,$page);
fclose($hd);
if (200 != $httpcode)
{
echo "<br>code connecter_fax = $httpcode <br>";
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////
function emettre_fax ($fax, $id, $idt, $email_ack, $destinataire)
{
$fax_file = __DIR__."/fax.txt";
$hd = fopen($fax_file,"w+");
fwrite($hd,$fax);
fclose($hd);
$fax_url = "https://adsl.free.fr/tel_ulfax.pl";
$ch = curl_init(); // création d'une nouvelle ressource CURL
// configuration de l'URL et d'autres options
curl_setopt($ch, CURLOPT_URL, $fax_url);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$length = strlen($fax);
$postdata = array(
'id' => $id,
'idt' => $idt,
'destinataire' => $destinataire,
'email_ack' => $email_ack,
'masque' => 'N',
'document' => "@".$fax_file
);
$httpheaders = array(
'Content-type' => 'multipart/form-data'
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheaders);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
$page = curl_exec($ch); // récupération du contenu de la page
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch); // fermeture de la session curl
$trace_file = __DIR__."/emettre_fax.txt";
$hd = fopen($trace_file,"w+");
fwrite($hd,$page);
fclose($hd);
if (302 != $httpcode)
{
echo "<br>code emettre_fax = $httpcode <br>";
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////
function envoyer_fax ($msg, $login, $password, $destinataire, $email_ack)
{
$free_url = "https://subscribe.free.fr/login/login.pl";
$ch = curl_init(); // création d'une nouvelle ressource CURL
// configuration de l'URL et d'autres options
curl_setopt($ch, CURLOPT_URL, $free_url);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'login' => $login,
'pass' => $password ));
$page = curl_exec($ch); // récupération du contenu de la page
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch); // fermeture de la session curl
$trace_file = __DIR__."/trace_login.txt";
$hd = fopen($trace_file,"w+");
fwrite($hd,$page);
fclose($hd);
if (302 != $httpcode)
{
echo "<br>code envoyer_fax = $httpcode <br>";
return false;
}
$id= "";
$idt= "";
obtenir_id_idt($page, $id, $idt);
//echo "<br>id ====>>> $id <br>";
//echo "<br>idt ====>>> $idt <br>";
connecter_fax ($id, $idt);
emettre_fax ($msg, $id, $idt, $email_ack, $destinataire);
}
?> -
-
-
-
Je pense qu'il faut faire une croix dessus. Plus de mise à jours. Même le site de l'éditeur est en carafe
Et en passant par l'interface fax de free... ça marche avec certain fax.destinataires et plante avec d'autres.
Je pensais résilier ma ligne FT spécifique fax mais m'est avis que j'ai bien fait de la garder -
Pareil pour moi : "Impossible de définir l'adresse de retour et envoie qui ne se fait pas".
Je me dis que ça vient peut être des identifiants. Je ne sais pas quoi utiliser : le numéro de ligne free 09..., le numéro de fax free 09..., le numéro de ligne support ADSL 01..., l'identifiant Freebox fbx.... Ensuite faut-il ou non compléter l'identifiant retenu par le suffixe "@freeadsl" ?
Merci par avance à ceux pour qui qfreefax 0.4.2 fonctionne d'un retour -
-
-
-
-
-
-
-
-
-
-
Super, simple et efficace.
Il y a quand meme le message de Windows7 qui déconseille l'installation et n'autorise pas l'éxécution automatique après l'avoir téléchargé. Il faudra persister (aller le chercher dans le repertoire télécharger et exécuter).
Le résultat en vaut la peine, je vais certainement contribuer à un dotation mais seulement après un temps d'observation de 2 semaines.. -
-
- 1
- 2
Suivant
- 1
- 2
Suivant