Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2943 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  qu'est qui peux empecher mon mail() de s'executer

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

qu'est qui peux empecher mon mail() de s'executer

n°405105
weed
Posté le 22-05-2003 à 22:05:55  profilanswer
 

c trop bizzare la fonction mail ()s'execute bien ds un fichier  
 
ms des que je le mets ds mon fichier devis, ca fonctionne pas  
Can't connect to server ......
 
 

mood
Publicité
Posté le 22-05-2003 à 22:05:55  profilanswer
 

n°405108
weed
Posté le 22-05-2003 à 22:07:19  profilanswer
 

malgré la longueur du source, je vous le mets au cas ou ca peut aider à trouver cette foutu ft qui empeche mail():
 

Code :
  1. <?php
  2. $separator = 'prix=';
  3. include("../../include/ma_config.php" );
  4. mysql_connect($hostname,$mysqluser,$mysqlpswd);
  5. mysql_selectdb($database) or die($diemessage);
  6. $tva /= 100;
  7. $msghtml = $msghtml_tmp;
  8. $msghtml_admin = $msghtml_tmp;
  9. $msghtml_admin .= "
  10.             <th width='95px'>
  11.                 Prix coutant € HT
  12.             </th>
  13.             <th width='95px'>
  14.                 Marge
  15.             </th>
  16.             ";
  17. $msghtml_tmp = "<th width='95px'>
  18.    Prix € HT
  19.   </th>
  20.   <th width='95px'>
  21.    Prix € TTC
  22.   </th>
  23.             <th width='95px'>
  24.    Prix FF TTC
  25.   </th>
  26.   </tr>";
  27. $msghtml .= $msghtml_tmp;
  28. $msghtml_admin .= $msghtml_tmp;
  29. $msg = "Entreprise :\n$nom_entreprise\n$adresse\n$cp  $ville\n\n\nArticle choisi :\n";
  30. $totaleuroht =0;
  31. $totalmarge  =0;
  32. $totalcoutant=0;
  33. //session_start();
  34. while(list($cle,$val) = each($article_choisi))
  35. {
  36.     if ($val != $separator)
  37.     {    list( $valeur, $tprix, $toto ) = split( $separator, $val);
  38. $req1 = mysql_query("SELECT col1, col7 FROM fichier WHERE col2='$valeur' " ) ;
  39. if (!$req1) echo "Selection impossible";
  40. while ($menu = mysql_fetch_object($req1))
  41. {
  42.         if ($menu->col7 != "" )
  43.         {
  44.          //prix coutant
  45.         $msg .="\n$menu->col1 (prix coutant $menu->col7 euros HT )";
  46.         $msghtml_tmp="<tr>
  47.                     <td>
  48.                         $menu->col1
  49.                     <td>
  50.      $valeur
  51.       </td>
  52.                   ";
  53.         $msghtml .= $msghtml_tmp;
  54.         $msghtml_admin .= $msghtml_tmp;
  55.                         //prix coutant par article
  56.         $msghtml_admin .= "<td align=right>".sprintf("%.2f",$menu->col7)."</td>";
  57.                        $totalcoutant +=$menu->col7;
  58.                         //la marge par produit en euros ...
  59.                        $tmp_marge = $menu->col7*$stx;
  60.                        $totalmarge +=$tmp_prix;
  61.         $msghtml_admin .= "<td align=right>".sprintf("%.2f",$tmp_marge)."</td>";
  62.                         //prix euro ht marge comprise
  63.                        $tmp_prix = $menu->col7+ ($menu->col7*$stx);
  64.                        $totaleuroht += $tmp_prix;
  65.         $msghtml_tmp  ="<td align=right>".sprintf("%.2f",$tmp_prix)."</td> ";
  66.         $msghtml_admin .= $msghtml_tmp;
  67.         $msghtml .= $msghtml_tmp;
  68.                        $msg .= "$tmp_prix euros HT";
  69.                         //prix ttc
  70.                         $tmp_prix += $tmp_prix * $tva  ;
  71.                         $msg .= " $tmp_prix euros TTC";
  72.         $msghtml_tmp = "<td align=right>".sprintf("%.2f",$tmp_prix)."</td>";
  73.         $msghtml .= $msghtml_tmp;
  74.         $msghtml_admin .= $msghtml_tmp;
  75.                        //pric ttc ff
  76.                        $tmp_prix *= 6.55957;
  77.         $msghtml_tmp ="<td align=right>".sprintf("%.2f",$tmp_prix)."
  78.                      </td>
  79.              </tr>
  80.     ";
  81.         $msghtml .= $msghtml_tmp;
  82.         $msghtml_admin .= $msghtml_tmp;
  83.       }
  84. }
  85. }
  86. }
  87. $msghtml_tmp =" <tr height=25>
  88.                 <td></td><td></td><td></td>
  89.             </tr>
  90.       <tr>
  91.     <td>
  92.     <b>Total</b>
  93.     </td>
  94.                     <td></td>
  95.             ";
  96. $msghtml       .= $msghtml_tmp;
  97. $msghtml_admin .= $msghtml_tmp;
  98.                //total prix coutant & total de la marge faite
  99. $msghtml_admin .= "<td align=right>
  100.                        ".sprintf("%.2f",$totalcoutant)."
  101.                    </td>
  102.                    <td align=right>
  103.                        ".sprintf("%.2f",$totalcoutant*$stx)."
  104.                    </td>
  105.                    ";
  106.                //total euro HT
  107. $msghtml_tmp      ="<td align=right>".sprintf("%.2f",$totaleuroht)."
  108.                     </td>
  109.     <td></td>
  110.   </tr>
  111.                  ";
  112. $msghtml .= $msghtml_tmp;
  113. $msghtml_admin .= $msghtml_tmp;
  114.                    //affiche du taux de la TVA
  115. $msghtml_tmp      ="<tr>
  116.                         <td><b>TVA a ".sprintf("%.2f",$tva*100)."%</b></td>
  117.                         <td></td>
  118.                    ";
  119. $msghtml .= $msghtml_tmp;
  120. $msghtml_admin .= $msghtml_tmp;
  121. $msghtml_admin .=  "    <td></td>
  122.                         <td></td>
  123.                    ";
  124. $msghtml_tmp =   " <td align=right>".sprintf("%.2f",$totaleuroht*$tva)."</td>
  125.                     </tr>
  126.                  ";
  127. $msghtml .= $msghtml_tmp;
  128. $msghtml_admin .= $msghtml_tmp;
  129. $msghtml_tmp =    "<tr>
  130.                          <td><b>TOTAL TTC</b></td>
  131.                          <td></td>
  132.                   ";
  133. $msghtml .= $msghtml_tmp;
  134. $msghtml_admin .= $msghtml_tmp;
  135. $msghtml_admin .= "       <td></td>
  136.                           <td></td>
  137.                  ";
  138. $msghtml_tmp =   "<td align=right>".sprintf("%.2f",$totaleuroht*$tva+$totaleuroht)."</td>
  139.                    </tr>
  140.     </table>
  141.     </div>";
  142. $msghtml .= $msghtml_tmp;
  143. $msghtml_admin .= $msghtml_tmp;
  144. echo "$msghtml";
  145. echo "<br><br><br><br>subjet $subjet<br><br> msg $msg";
  146. mail ( 'mt.hood@freesbee.fr','subjet','msg');
  147. //include ("mail_html.php" );
  148. //mail_html('mt.hd@freesbee.fr', 'Votre configuration' , '', $msghtml , 'j.hube@caramail.com')
  149. //mail ( '$mail','$subjet','$msg');
  150. ?>


 
le source fonctionne bien biensur sans la fonction mail();....


Message édité par weed le 22-05-2003 à 22:09:28
n°405119
docwario
Alea jacta est
Posté le 22-05-2003 à 22:17:13  profilanswer
 

au choix:
 
si le serveur php est chez toi, tu as pas spécifié de serveur smtp dans php.ini
 
si c sur ton hebergeur, il a bloque la fonction mail ( mais t aurais un message d erreur kom koi c bloké)

n°405128
weed
Posté le 22-05-2003 à 22:24:56  profilanswer
 

weed a écrit :

c trop bizzare la fonction mail ()s'execute bien ds un fichier
 
ms des que je le mets ds mon fichier devis, ca fonctionne pas  
Can't connect to server ......
 
 


 
je me suis peut etre mal exprimé ....
comme je l'ai dis si je lance mon fichier test_mail

Code :
  1. <?php
  2. mail ( 'mt.hood@freesbee.fr','subjet','msg');
  3. ?>


tout baigne ms lorsque je fais un copié collé de la fonction mail ds mon devis.php, cela ne marche (dc mon smtp est bien configuré).....
 
je pense  

  • qu'il y a une fonction qui empeche  
  • ou ca se trouve j'ai fait une erreur ds le fichier que la fonction mail() n'accepte pas, ft bcp plus ensible peut etre ...  

n°405155
docwario
Alea jacta est
Posté le 22-05-2003 à 22:38:58  profilanswer
 

t sur que ca :
 
$msghtml_tmp =   "<td align=right>".sprintf("%.2f",$totaleuroht*$tva+$totaleuroht)."</td>
                     </tr>
      </table>
      </div>";
 
fonctionne ?
 
edit : g rien dit....


Message édité par docwario le 22-05-2003 à 22:41:00
n°405161
weed
Posté le 22-05-2003 à 22:43:24  profilanswer
 

DocWario a écrit :

t sur que ca :
 
$msghtml_tmp =   "<td align=right>".sprintf("%.2f",$totaleuroht*$tva+$totaleuroht)."</td>
                     </tr>
      </table>
      </div>";
 
fonctionne ?
 
edit : g rien dit....


;) sprintf te permet de formatter comme en C, ici avoir de chiifres la virgule.
 
Edit : j'ai essayer de mettre des truc en commentaire pour isoler le cas ms      je trouve pas ...


Message édité par weed le 22-05-2003 à 22:45:40
n°406766
weed
Posté le 24-05-2003 à 12:18:57  profilanswer
 

un petit up

n°409681
weed
Posté le 27-05-2003 à 19:05:19  profilanswer
 

biazzare qd meme un mail(); tout court ds un fichier ca fonctionne du tonnerre  
ms la des que je le mets ds mon fichier devis.php plus rien ....
 
je suis sous easyphp1.6 ....

n°409682
RiderCrazy
Posté le 27-05-2003 à 19:08:09  profilanswer
 

tu dis que t'es sous easyphp 1.6
t'es en local alors et pour pouvoir envoyer un mail, il faut que tu configures le smtp dans php.ini

n°409687
weed
Posté le 27-05-2003 à 19:16:12  profilanswer
 

lol meme remarque que DocWario
 
j'ai dis qu'un simple fichier avec mail()  

Code :
  1. <?php
  2.   //mail ( 'mt.hood@freesbee.fr','subjet','msg');
  3.   $subjet = "mlkmlksdlmk";
  4.   $msg = "kjkljlkjklj";
  5.  
  6.    mail ( 'mt.hood@freesbee.fr',$subjet,$msg);
  7. ?>


fonctionnait du tonnerre  
 
==> bonne config de mon php.ini  
 

Code :
  1. [mail function]
  2. SMTP=smtp.9online.fr ;for win32 only
  3. sendmail_from=mt.hood@freesbee.fr ;for win32 only
  4. ;sendmail_path =      ;for unix only, may supply arguments as well (default is 'sendmail -t -i')


 

mood
Publicité
Posté le 27-05-2003 à 19:16:12  profilanswer
 

n°409695
RiderCrazy
Posté le 27-05-2003 à 19:31:25  profilanswer
 

tu voudrais pas nous mettre l'erreur complète aussi stp...

n°409700
weed
Posté le 27-05-2003 à 19:42:46  profilanswer
 

je crois que c un truc du genre  

Code :
  1. Can not to connect to server


 
je verifie ca tout de suite ....


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  qu'est qui peux empecher mon mail() de s'executer

 

Sujets relatifs
Comment faire en sorte de tester la fonction mail lorsqu'on utilise EAPkoi IE demande une authorisation pour executer certaines applets ?
[PHP] Accusé de réception à un mail[C]executer un exe dans le dossier parent
[c++ borland] Comment faire pour executer racourci ?[PHP] Mail avec destintaire affiché plutôt que adresse du destinataire
[java] éxecuter un programme externe[c++ builder] Copier puis executer fichier en c/c++ ?
Comment empecher la mise en cache d'un .swf ?PB fonction mail() EasyPHP et serveur SMTP IIS
Plus de sujets relatifs à : qu'est qui peux empecher mon mail() de s'executer


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR