Aller au contenu

probleme envoi mail


2501gigi

Sujets conseillés

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.

<EDIT:> Merci d'utiliser le [ CODEBOX] pour les codes longs.

Lien vers le commentaire
Partager sur d’autres sites

ben fais un truc du genre :

$texte = '<html>bla bla ....
<h1>toto</h1>
<p>Voici un mail pour ' . $nom-du-gars . ' etc ...</p>
<strong>Et surtout mets bien un \\ devant le \', sinon ça marchera pas !';

Et tu mets $texte dans ta fonction mail.

Lien vers le commentaire
Partager sur d’autres sites

Règles de base en php, il faut échaper les caractères spéciaux.

Essai les 2 scripts ci-dessous, tu comprendras vite, et cela vaudra mieux qu'un long discours :P

$texte = 'Bonjour l'ami';
echo $texte;

$texte = 'Bonjour l\'ami';
echo $texte;

Lien vers le commentaire
Partager sur d’autres sites

Je vais faire un effort pour l'orthographe mais il me semble que c'etait bon.

Voila je voulais savoir si il fallait les points avant est apres chaque variable comme dans l'exemple :' . $nom-du-gars . ' pour pouvoir les mettre (les variables) dans les message.

Et si il fallait aussi les apostrophes (') pour encadrait les variables.

Merci de vos reponses.

En espérant ne pas avoir fait trop de fautes se coup-ci et que mon message sera compréhensif.

Lien vers le commentaire
Partager sur d’autres sites

Veuillez vous connecter pour commenter

Vous pourrez laisser un commentaire après vous êtes connecté.



Connectez-vous maintenant
×
×
  • Créer...