Page 1 sur 1

problem mail

Posté : 03 juil. 2006, 14:06
par 2501gigi
Voila j'ai un souci j'ai mon bon de commande que je voudrais envoyer par mail mais le soucis est que l'on ne peut pas mettre de php dans la fonction mail.

Voila mon code du mail que j'aimerais envoyer:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p> <?php echo $etatC ; ?> <?php echo $row_Recordset2['nomfac']; ?><?php echo $row_Recordset2['prenomfac']; ?>,</p>
<p>Merci d avoir passé commande chez<strong><br>
Conservez ce mail car il tient lieu de facture. </strong></p>
<table width="429" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="225">Commande n° <?php echo $row_Recordset3['ID']; ?></td>
<td width="204">du <?php echo $row_Recordset3['date']; ?></td>
</tr>
</table>
<br>
<table width="559" border="0" cellspacing="0">
<tr>
<td width="166"><div align="center">Désignation</div></td>
<td width="138"><div align="center">Prix Unitaire </div></td>
<td width="112"><div align="center">Quantité</div></td>
<td width="135"><div align="center">Prix Article </div></td>
</tr>
<tr>
<td>---------------------------</td>
<td>-----------------------</td>
<td>------------------</td>
<td>----------------------</td>
</tr>
<?php do { ?>
<tr>
<td><div align="center"><?php echo $row_Recordset4['nomArti']; ?></div></td>
<td><div align="center"><?php echo $row_Recordset4['prixUni']; ?></div></td>
<td><div align="center"><?php echo $row_Recordset4['Qu']; ?></div></td>
<td><div align="center"><?php echo $row_Recordset4['prixArti']; ?></div></td>
</tr>
<?php } while ($row_Recordset4 = mysql_fetch_assoc($Recordset4)); ?>
</table>
---------------------------------------------------------------------------------------------<br>
<table width="581" border="0" cellspacing="0">
<tr>
<td width="202"> </td>
<td width="375"><table width="284" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="118"><div align="center">Total T.T.C : </div></td>
<td width="166"><div align="center"><?php echo $row_Recordset3['totalcom']; ?> €</div></td>
</tr>
</table></td>
</tr>
</table>
<br>
<strong>Adresse de livraison :<br>
<br>
</strong>
<table width="559" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="195"><div align="center"><strong>NOM : </strong></div></td>
<td width="358"><div align="center"><?php echo $row_Recordset1['nom']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>PRENOM : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset1['prenom']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>ADRESSE : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset1['adresse']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>CODE POSTAL : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset1['cp']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>VILLE : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset1['ville']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>TELEPHONE : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset1['tel']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>MAIL : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset1['mail']; ?></div></td>
</tr>
</table>
<br>
<strong>Adresse de facturation :<br> 
<br>
</strong>
<table width="559" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="195"><div align="center"><strong>NOM : </strong></div></td>
<td width="358"><div align="center"><?php echo $row_Recordset2['nomfac']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>PRENOM : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset2['prenomfac']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>ADRESSE : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset2['adressefac']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>CODE POSTAL : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset2['cpfac']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>VILLE : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset2['villefac']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>TELEPHONE : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset2['telfac']; ?></div></td>
</tr>
<tr>
<td><div align="center"><strong>MAIL : </strong></div></td>
<td><div align="center"><?php echo $row_Recordset2['mailfac']; ?></div></td>
</tr>
</table>
<strong></strong>
<p>Merci de votre visite, en espérant vous revoir bientôt. </p>
</body>
</html>
Voila surtout que le probleme sera de creer une ligne pour chaque article que contient le tableau.

Merci a tous et si quelqu'un à une soluce a me proposer.

Posté : 03 juil. 2006, 14:10
par ouckileou
Ben tu crées le texte dynamiquement avant et tu le met dans le corps du mail.. je comprends pas trop le problème là :roll:

Posté : 03 juil. 2006, 17:39
par Invité
Merci mais comment on mais le texte dynamiquement.

C'est à dire par exemple $truc= $row_Recordset3['ID']; et apres je mais $truc dans mon mail.


Et puis avec cette methode comment j'envois les article de mon panier car il faut quand meme creer un tableau pour les afficher.

Bon en esperant mettre bien exprimé.

Merci encore

Posté : 03 juil. 2006, 17:56
par ouckileou
Au lieu d'afficher ton HTML et tes variables, tu les stockes dans une variable $texte, et tu mets cette variable dans le mail

T'es obligé de mettre du HTML ? normalement on met du simple texte dans un mail, tu sais pas trop comment ça va être affiché à l'arrivée sinon... :roll:

Posté : 03 juil. 2006, 18:54
par 2501gigi
que faudrait-il quand on a un utilisateur admetons avec l'ID 1 mais que pour cet utilisateur il y est plusieurs articles et apres il faut bien afficher tous les articles qu'il a mis dans son panier et les mettre en forme pour qu'il y et un semblant de recapitulatif (nom article,prix,quantite et prixtotal).

Voila c'est la que je but (allez les bleus).

Posté : 04 juil. 2006, 16:03
par Invité
est il possible d'imprimer une page sans appuyer sur aucun bouton.

Je m'explique j'ai creé une page similaire a ma page recapitulatif qui recupere les meme données mais de telle facon que sa rentre pour un format d'impression.

Je fait appel a cette page par un bouton et quand je tombe dessus je veut que sa l'imprime direct puis une redirection se fait dans la seconde qui suit.

Bon voila j'attend vous reponses.MERCI :P

Posté : 04 juil. 2006, 16:17
par ouckileou
Quel rapport avec le sujet de départ ? Tu es le même posteur ?

C'est possible en javascript (impression et redirection)

Posté : 04 juil. 2006, 17:06
par Invité
desoler je me suis tromper de post mais merci pour la reponse j'ai trouvai.