Probleme php mail avec formulaire
Nico9130
-
nico9130 -
nico9130 -
Bonjour,
j'ai un souci sur un site que je dois réparer; la fonction mail avec l'envoi d'un formulaire ne marche pas ...
Je ne suis pas très calé sur le php donc je sèche ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>AGIR - Une passerelle vers la vie active</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../AGIR 15052008/mm_training.css" type="text/css">
<style type="text/css">
<!--
body {
margin-top: 10px;
background-color: #F99933;
}
.Style16 {
color: #0054A5;
font-weight: bold;
}
a:link {
color: #F99933;
}
a:hover {
color: #FC0;
}
.Style18 {
font-size: 14px;
color: #0054A5;
font-weight: bold;
}
.tab_hover {
background-color: #36F;
}
.Style19 {color: #F99933}
.Style20 {color: #F99933; font-size: 14px; }
.Style22 {
color: #F99933;
font-size: 14px;
font-weight: bold;
}
a:active {
color: #F99933;
}
.Style23 {font-size: 14px}
.Style24 {font-size: 12px; }
.Style25 {font-size: 12; }
.Style26 {font-size: 13px; }
-->
</style></head>
<body>
<table width="101%" border="0" cellpadding="0" cellspacing="0" bordercolor="#0054A5" bgcolor="#0054A5">
<tr bgcolor="#F99933">
<td height="70" colspan="3" nowrap="nowrap"><div align="center">
<p><img src="../AGIR 15052008/Sans titre3.jpg" width="401" height="142"></p>
<p><span class="Style18">ASSOCIATION POUR GENERER L'INSERTION ET LA REUSSITE </span></p>
</div></td>
</tr>
<tr bgcolor="#FF6600">
<td colspan="3" bgcolor="#0054A5"><img src="../AGIR 15052008/mm_spacer.gif" alt="" width="1" height="4" border="0"></td>
</tr>
<tr bgcolor="#D3DCE6">
<td colspan="3"><img src="../AGIR 15052008/mm_spacer.gif" alt="" width="1" height="1" border="0"></td>
</tr>
<tr bgcolor="#F99933">
<td height="24" colspan="3" nowrap="nowrap" bgcolor="#F99933"><marquee>
<span class="Style16"><a href="../AGIR 15052008/dons.html"><FONT COLOR="#0054A5">FAITES VOS DONS </a> </span>
</marquee></td>
</tr>
<tr bgcolor="#D3DCE6">
<td colspan="3"><img src="../AGIR 15052008/mm_spacer.gif" alt="" width="1" height="1" border="0"></td>
</tr>
<tr bgcolor="#FF6600">
<td colspan="3" bordercolor="#0054A5" bgcolor="#0054A5"><img src="../AGIR 15052008/mm_spacer.gif" alt="" width="1" height="4" border="0"></td>
</tr>
<tr bgcolor="#D3DCE6">
<td colspan="3"><img src="../AGIR 15052008/mm_spacer.gif" alt="" width="1" height="1" border="0"></td>
</tr>
<tr bgcolor="#D3DCE6">
<td width="112" valign="top" bgcolor="#0054A5"><script language="JavaScript" src="../AGIR 15052008/Menu.js" type="text/JavaScript">
</script>
<p align="left"> </p> </td>
<td width="3" bgcolor="#0054A5"><p> </p></td>
<td width="866" valign="top" bordercolor="#FF6600" bgcolor="#0054A5"><p><a href="../../../../../admineleve/Bureau/Site AGIR/AGIR/ejs_menu_dyn_vert.js"></a></p>
<p align="center"><a href="../AGIR 15052008/repassage.html"></a></p>
<p align="center"> </p>
<p align="center" class="Style22">FORMULAIRE À EXPÉDIER</p>
<p align="center"> </p>
<div align="center">
<p class="Style19"><?php
$mailaexp = 'Commande du ';
$mailaexp = $mailaexp.$_POST['date'].' de '.$_POST['nom'].', habitant '.$_POST['adresse'].'. Son adresse mail est : '.$_POST['mail'].' et son numéro de téléphone : '.$_POST['tel'].'. Observations : '.$_POST['observ'].'. Date de retour le : '.$_POST['dat_ret'].'.';
if (isset($_POST['choix1']))
{
$mailaexp = $mailaexp.'Individuel 2€ ; ';
}
else if (isset($_POST['choix2']))
{
$mailaexp = $mailaexp.'A partir de 5 pers – 1.00 € / pers ; ';
}
else if (isset($_POST['choix3']))
{
$mailaexp = $mailaexp.'A partir de 10 pers – gratuit ; ';
}
if (isset($_POST['choix4']))
{
$mailaexp = $mailaexp.'Lavage de vêtements 4€/kg ; ';
}
if ($_POST['01'] != '')
{
$mailaexp = $mailaexp.'Alèse = '.$_POST['01'].' ; ';
}
if ($_POST['02'] != '')
{
$mailaexp = $mailaexp.'Bermuda = '.$_POST['02'].' ; ';
}
if ($_POST['03'] != '')
{
$mailaexp = $mailaexp.'Blouse = '.$_POST['03'].' ; ';
}
if ($_POST['04'] != '')
{
$mailaexp = $mailaexp.'Blouson = '.$_POST['04'].' ; ';
}
if ($_POST['05'] != '')
{
$mailaexp = $mailaexp.'Caleçon = '.$_POST['05'].' ; ';
}
if ($_POST['06'] != '')
{
$mailaexp = $mailaexp.'Chemise de nuit = '.$_POST['06'].' ; ';
}
if ($_POST['07'] != '')
{
$mailaexp = $mailaexp.'Chemise homme (MC) = '.$_POST['07'].' ; ';
}
if ($_POST['08'] != '')
{
$mailaexp = $mailaexp.'Chemisse homme (ML) = '.$_POST['08'].' ; ';
}
if ($_POST['09'] != '')
{
$mailaexp = $mailaexp.'Chemisier (MC) = '.$_POST['09'].' ; ';
}
if ($_POST['10'] != '')
{
$mailaexp = $mailaexp.'Chemisier (ML) = '.$_POST['10'].' ; ';
}
if ($_POST['11'] != '')
{
$mailaexp = $mailaexp.'Double rideau = '.$_POST['11'].' ; ';
}
if ($_POST['12'] != '')
{
$mailaexp = $mailaexp.'Drap de bain = '.$_POST['12'].' ; ';
}
if ($_POST['13'] != '')
{
$mailaexp = $mailaexp.'Drap housse 1 pers = '.$_POST['13'].' ; ';
}
if ($_POST['14'] != '')
{
$mailaexp = $mailaexp.'Drap housse 2 pers = '.$_POST['14'].' ; ';
}
if ($_POST['15'] != '')
{
$mailaexp = $mailaexp.'Drap plat = '.$_POST['15'].' ; ';
}
if ($_POST['16'] != '')
{
$mailaexp = $mailaexp.'Gant de toilette - Mouchoir = '.$_POST['16'].' ; ';
}
if ($_POST['17'] != '')
{
$mailaexp = $mailaexp.'Gilet – Tee shirt = '.$_POST['17'].' ; ';
}
if ($_POST['18'] != '')
{
$mailaexp = $mailaexp.'Housse de couette 1 pers = '.$_POST['18'].' ; ';
}
if ($_POST['19'] != '')
{
$mailaexp = $mailaexp.'Housse de couette 2 pers = '.$_POST['19'].' ; ';
}
if ($_POST['20'] != '')
{
$mailaexp = $mailaexp.'Housse de matelas = '.$_POST['20'].' ; ';
}
if ($_POST['21'] != '')
{
$mailaexp = $mailaexp.'Imperméable = '.$_POST['21'].' ; ';
}
if ($_POST['22'] != '')
{
$mailaexp = $mailaexp.'Jupe courte = '.$_POST['22'].' ; ';
}
if ($_POST['23'] != '')
{
$mailaexp = $mailaexp.'Jupe longue = '.$_POST['23'].' ; ';
}
if ($_POST['24'] != '')
{
$mailaexp = $mailaexp.'Jupe plissée = '.$_POST['24'].' ; ';
}
if ($_POST['25'] != '')
{
$mailaexp = $mailaexp.'Manteau = '.$_POST['25'].' ; ';
}
if ($_POST['26'] != '')
{
$mailaexp = $mailaexp.'Nappe = '.$_POST['26'].' ; ';
}
if ($_POST['27'] != '')
{
$mailaexp = $mailaexp.'Pantacourt – Corsaire = '.$_POST['27'].' ; ';
}
if ($_POST['28'] != '')
{
$mailaexp = $mailaexp.'Pantalon à pinces = '.$_POST['28'].' ; ';
}
if ($_POST['29'] != '')
{
$mailaexp = $mailaexp.'Pantalon Jean = '.$_POST['29'].' ; ';
}
if ($_POST['30'] != '')
{
$mailaexp = $mailaexp.'Pantalon jogging = '.$_POST['30'].' ; ';
}
if ($_POST['31'] != '')
{
$mailaexp = $mailaexp.'Polo - Pull = '.$_POST['31'].' ; ';
}
if ($_POST['32'] != '')
{
$mailaexp = $mailaexp.'Pyjama complet = '.$_POST['32'].' ; ';
}
if ($_POST['33'] != '')
{
$mailaexp = $mailaexp.'Rideau voile = '.$_POST['33'].' ; ';
}
if ($_POST['34'] != '')
{
$mailaexp = $mailaexp.'Robe à bretelles = '.$_POST['34'].' ; ';
}
if ($_POST['35'] != '')
{
$mailaexp = $mailaexp.'Robe de chambre - Peignoir = '.$_POST['35'].' ; ';
}
if ($_POST['36'] != '')
{
$mailaexp = $mailaexp.'Robe enfant = '.$_POST['36'].' ; ';
}
if ($_POST['37'] != '')
{
$mailaexp = $mailaexp.'Robe femme = '.$_POST['37'].' ; ';
}
if ($_POST['38'] != '')
{
$mailaexp = $mailaexp.'Robe longue = '.$_POST['38'].' ; ';
}
if ($_POST['39'] != '')
{
$mailaexp = $mailaexp.'Salopette = '.$_POST['39'].' ; ';
}
if ($_POST['40'] != '')
{
$mailaexp = $mailaexp.'Serviette de toilette = '.$_POST['40'].' ; ';
}
if ($_POST['41'] != '')
{
$mailaexp = $mailaexp.'Sweat = '.$_POST['41'].' ; ';
}
if ($_POST['42'] != '')
{
$mailaexp = $mailaexp.'Taie d’oreiller à volant = '.$_POST['42'].' ; ';
}
if ($_POST['43'] != '')
{
$mailaexp = $mailaexp.'Torchon = '.$_POST['43'].' ; ';
}
if ($_POST['44'] != '')
{
$mailaexp = $mailaexp.'Traversin – Taie d’oreiller = '.$_POST['44'].' ; ';
}
if ($_POST['45'] != '')
{
$mailaexp = $mailaexp.'Veste = '.$_POST['45'].' ; ';
}
if ($_POST['46'] != '')
{
$mailaexp = $mailaexp.'Veste jogging = '.$_POST['46'].' ; ';
}
if ($_POST['47'] != '')
{
$mailaexp = $mailaexp.'Vêtement lin et soie = '.$_POST['47'].' ; ';
}
$mail = $_POST['mail'];
$from_email ='gorgauths@hotmail.fr';
$headers ='From: $from_email \n';
$headers .='Reply-to: $mail \n';
$headers .='Content-Type: text/html; charset="iso-8859-1 \n';
$headers .='Content-Transfer-Encoding: 8bit';
$message ='<html><head><title>Nouvelle commande</title></head><body><?php echo $mailaexp; ?></body></html>';
if(@mail('adressmail', 'Nouvelle commande', $message, $headers))
{
echo 'Le formulaire a été envoyé.';
}
else
{
echo 'Le formulaire n\'a pu être envoyé.';
}
?></p>
</div></td>
</tr>
<tr>
<td width="112" bgcolor="#0054A5"
> <br>
<br> </td>
<td width="3" bgcolor="#0054A5"> </td>
<td bgcolor="#0054A5"> </td>
</tr>
</table>
</body>
</html>
j'ai un souci sur un site que je dois réparer; la fonction mail avec l'envoi d'un formulaire ne marche pas ...
Je ne suis pas très calé sur le php donc je sèche ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>AGIR - Une passerelle vers la vie active</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../AGIR 15052008/mm_training.css" type="text/css">
<style type="text/css">
<!--
body {
margin-top: 10px;
background-color: #F99933;
}
.Style16 {
color: #0054A5;
font-weight: bold;
}
a:link {
color: #F99933;
}
a:hover {
color: #FC0;
}
.Style18 {
font-size: 14px;
color: #0054A5;
font-weight: bold;
}
.tab_hover {
background-color: #36F;
}
.Style19 {color: #F99933}
.Style20 {color: #F99933; font-size: 14px; }
.Style22 {
color: #F99933;
font-size: 14px;
font-weight: bold;
}
a:active {
color: #F99933;
}
.Style23 {font-size: 14px}
.Style24 {font-size: 12px; }
.Style25 {font-size: 12; }
.Style26 {font-size: 13px; }
-->
</style></head>
<body>
<table width="101%" border="0" cellpadding="0" cellspacing="0" bordercolor="#0054A5" bgcolor="#0054A5">
<tr bgcolor="#F99933">
<td height="70" colspan="3" nowrap="nowrap"><div align="center">
<p><img src="../AGIR 15052008/Sans titre3.jpg" width="401" height="142"></p>
<p><span class="Style18">ASSOCIATION POUR GENERER L'INSERTION ET LA REUSSITE </span></p>
</div></td>
</tr>
<tr bgcolor="#FF6600">
<td colspan="3" bgcolor="#0054A5"><img src="../AGIR 15052008/mm_spacer.gif" alt="" width="1" height="4" border="0"></td>
</tr>
<tr bgcolor="#D3DCE6">
<td colspan="3"><img src="../AGIR 15052008/mm_spacer.gif" alt="" width="1" height="1" border="0"></td>
</tr>
<tr bgcolor="#F99933">
<td height="24" colspan="3" nowrap="nowrap" bgcolor="#F99933"><marquee>
<span class="Style16"><a href="../AGIR 15052008/dons.html"><FONT COLOR="#0054A5">FAITES VOS DONS </a> </span>
</marquee></td>
</tr>
<tr bgcolor="#D3DCE6">
<td colspan="3"><img src="../AGIR 15052008/mm_spacer.gif" alt="" width="1" height="1" border="0"></td>
</tr>
<tr bgcolor="#FF6600">
<td colspan="3" bordercolor="#0054A5" bgcolor="#0054A5"><img src="../AGIR 15052008/mm_spacer.gif" alt="" width="1" height="4" border="0"></td>
</tr>
<tr bgcolor="#D3DCE6">
<td colspan="3"><img src="../AGIR 15052008/mm_spacer.gif" alt="" width="1" height="1" border="0"></td>
</tr>
<tr bgcolor="#D3DCE6">
<td width="112" valign="top" bgcolor="#0054A5"><script language="JavaScript" src="../AGIR 15052008/Menu.js" type="text/JavaScript">
</script>
<p align="left"> </p> </td>
<td width="3" bgcolor="#0054A5"><p> </p></td>
<td width="866" valign="top" bordercolor="#FF6600" bgcolor="#0054A5"><p><a href="../../../../../admineleve/Bureau/Site AGIR/AGIR/ejs_menu_dyn_vert.js"></a></p>
<p align="center"><a href="../AGIR 15052008/repassage.html"></a></p>
<p align="center"> </p>
<p align="center" class="Style22">FORMULAIRE À EXPÉDIER</p>
<p align="center"> </p>
<div align="center">
<p class="Style19"><?php
$mailaexp = 'Commande du ';
$mailaexp = $mailaexp.$_POST['date'].' de '.$_POST['nom'].', habitant '.$_POST['adresse'].'. Son adresse mail est : '.$_POST['mail'].' et son numéro de téléphone : '.$_POST['tel'].'. Observations : '.$_POST['observ'].'. Date de retour le : '.$_POST['dat_ret'].'.';
if (isset($_POST['choix1']))
{
$mailaexp = $mailaexp.'Individuel 2€ ; ';
}
else if (isset($_POST['choix2']))
{
$mailaexp = $mailaexp.'A partir de 5 pers – 1.00 € / pers ; ';
}
else if (isset($_POST['choix3']))
{
$mailaexp = $mailaexp.'A partir de 10 pers – gratuit ; ';
}
if (isset($_POST['choix4']))
{
$mailaexp = $mailaexp.'Lavage de vêtements 4€/kg ; ';
}
if ($_POST['01'] != '')
{
$mailaexp = $mailaexp.'Alèse = '.$_POST['01'].' ; ';
}
if ($_POST['02'] != '')
{
$mailaexp = $mailaexp.'Bermuda = '.$_POST['02'].' ; ';
}
if ($_POST['03'] != '')
{
$mailaexp = $mailaexp.'Blouse = '.$_POST['03'].' ; ';
}
if ($_POST['04'] != '')
{
$mailaexp = $mailaexp.'Blouson = '.$_POST['04'].' ; ';
}
if ($_POST['05'] != '')
{
$mailaexp = $mailaexp.'Caleçon = '.$_POST['05'].' ; ';
}
if ($_POST['06'] != '')
{
$mailaexp = $mailaexp.'Chemise de nuit = '.$_POST['06'].' ; ';
}
if ($_POST['07'] != '')
{
$mailaexp = $mailaexp.'Chemise homme (MC) = '.$_POST['07'].' ; ';
}
if ($_POST['08'] != '')
{
$mailaexp = $mailaexp.'Chemisse homme (ML) = '.$_POST['08'].' ; ';
}
if ($_POST['09'] != '')
{
$mailaexp = $mailaexp.'Chemisier (MC) = '.$_POST['09'].' ; ';
}
if ($_POST['10'] != '')
{
$mailaexp = $mailaexp.'Chemisier (ML) = '.$_POST['10'].' ; ';
}
if ($_POST['11'] != '')
{
$mailaexp = $mailaexp.'Double rideau = '.$_POST['11'].' ; ';
}
if ($_POST['12'] != '')
{
$mailaexp = $mailaexp.'Drap de bain = '.$_POST['12'].' ; ';
}
if ($_POST['13'] != '')
{
$mailaexp = $mailaexp.'Drap housse 1 pers = '.$_POST['13'].' ; ';
}
if ($_POST['14'] != '')
{
$mailaexp = $mailaexp.'Drap housse 2 pers = '.$_POST['14'].' ; ';
}
if ($_POST['15'] != '')
{
$mailaexp = $mailaexp.'Drap plat = '.$_POST['15'].' ; ';
}
if ($_POST['16'] != '')
{
$mailaexp = $mailaexp.'Gant de toilette - Mouchoir = '.$_POST['16'].' ; ';
}
if ($_POST['17'] != '')
{
$mailaexp = $mailaexp.'Gilet – Tee shirt = '.$_POST['17'].' ; ';
}
if ($_POST['18'] != '')
{
$mailaexp = $mailaexp.'Housse de couette 1 pers = '.$_POST['18'].' ; ';
}
if ($_POST['19'] != '')
{
$mailaexp = $mailaexp.'Housse de couette 2 pers = '.$_POST['19'].' ; ';
}
if ($_POST['20'] != '')
{
$mailaexp = $mailaexp.'Housse de matelas = '.$_POST['20'].' ; ';
}
if ($_POST['21'] != '')
{
$mailaexp = $mailaexp.'Imperméable = '.$_POST['21'].' ; ';
}
if ($_POST['22'] != '')
{
$mailaexp = $mailaexp.'Jupe courte = '.$_POST['22'].' ; ';
}
if ($_POST['23'] != '')
{
$mailaexp = $mailaexp.'Jupe longue = '.$_POST['23'].' ; ';
}
if ($_POST['24'] != '')
{
$mailaexp = $mailaexp.'Jupe plissée = '.$_POST['24'].' ; ';
}
if ($_POST['25'] != '')
{
$mailaexp = $mailaexp.'Manteau = '.$_POST['25'].' ; ';
}
if ($_POST['26'] != '')
{
$mailaexp = $mailaexp.'Nappe = '.$_POST['26'].' ; ';
}
if ($_POST['27'] != '')
{
$mailaexp = $mailaexp.'Pantacourt – Corsaire = '.$_POST['27'].' ; ';
}
if ($_POST['28'] != '')
{
$mailaexp = $mailaexp.'Pantalon à pinces = '.$_POST['28'].' ; ';
}
if ($_POST['29'] != '')
{
$mailaexp = $mailaexp.'Pantalon Jean = '.$_POST['29'].' ; ';
}
if ($_POST['30'] != '')
{
$mailaexp = $mailaexp.'Pantalon jogging = '.$_POST['30'].' ; ';
}
if ($_POST['31'] != '')
{
$mailaexp = $mailaexp.'Polo - Pull = '.$_POST['31'].' ; ';
}
if ($_POST['32'] != '')
{
$mailaexp = $mailaexp.'Pyjama complet = '.$_POST['32'].' ; ';
}
if ($_POST['33'] != '')
{
$mailaexp = $mailaexp.'Rideau voile = '.$_POST['33'].' ; ';
}
if ($_POST['34'] != '')
{
$mailaexp = $mailaexp.'Robe à bretelles = '.$_POST['34'].' ; ';
}
if ($_POST['35'] != '')
{
$mailaexp = $mailaexp.'Robe de chambre - Peignoir = '.$_POST['35'].' ; ';
}
if ($_POST['36'] != '')
{
$mailaexp = $mailaexp.'Robe enfant = '.$_POST['36'].' ; ';
}
if ($_POST['37'] != '')
{
$mailaexp = $mailaexp.'Robe femme = '.$_POST['37'].' ; ';
}
if ($_POST['38'] != '')
{
$mailaexp = $mailaexp.'Robe longue = '.$_POST['38'].' ; ';
}
if ($_POST['39'] != '')
{
$mailaexp = $mailaexp.'Salopette = '.$_POST['39'].' ; ';
}
if ($_POST['40'] != '')
{
$mailaexp = $mailaexp.'Serviette de toilette = '.$_POST['40'].' ; ';
}
if ($_POST['41'] != '')
{
$mailaexp = $mailaexp.'Sweat = '.$_POST['41'].' ; ';
}
if ($_POST['42'] != '')
{
$mailaexp = $mailaexp.'Taie d’oreiller à volant = '.$_POST['42'].' ; ';
}
if ($_POST['43'] != '')
{
$mailaexp = $mailaexp.'Torchon = '.$_POST['43'].' ; ';
}
if ($_POST['44'] != '')
{
$mailaexp = $mailaexp.'Traversin – Taie d’oreiller = '.$_POST['44'].' ; ';
}
if ($_POST['45'] != '')
{
$mailaexp = $mailaexp.'Veste = '.$_POST['45'].' ; ';
}
if ($_POST['46'] != '')
{
$mailaexp = $mailaexp.'Veste jogging = '.$_POST['46'].' ; ';
}
if ($_POST['47'] != '')
{
$mailaexp = $mailaexp.'Vêtement lin et soie = '.$_POST['47'].' ; ';
}
$mail = $_POST['mail'];
$from_email ='gorgauths@hotmail.fr';
$headers ='From: $from_email \n';
$headers .='Reply-to: $mail \n';
$headers .='Content-Type: text/html; charset="iso-8859-1 \n';
$headers .='Content-Transfer-Encoding: 8bit';
$message ='<html><head><title>Nouvelle commande</title></head><body><?php echo $mailaexp; ?></body></html>';
if(@mail('adressmail', 'Nouvelle commande', $message, $headers))
{
echo 'Le formulaire a été envoyé.';
}
else
{
echo 'Le formulaire n\'a pu être envoyé.';
}
?></p>
</div></td>
</tr>
<tr>
<td width="112" bgcolor="#0054A5"
> <br>
<br> </td>
<td width="3" bgcolor="#0054A5"> </td>
<td bgcolor="#0054A5"> </td>
</tr>
</table>
</body>
</html>
A voir également:
- Probleme php mail avec formulaire
- Whatsapp formulaire opposition - Guide
- Formulaire de réclamation facebook - Guide
- Publipostage mail - Accueil - Word
- Windows live mail - Télécharger - Mail
- Formulaire de reclamation instagram - Guide
4 réponses
oula c'est quoi ce code ???
tu a quoi comme erreur?
pour la fonction mail essaie ça
en ce qui concerne tes variable recuperees par post la y a un truc que je pige pas
pourquoi tu met = et apres encore = ????
je vais te donner un exemple, avant de commencer a concatener recupere tes variable
//je declare la variable $mailexp à vide
etc... jusqu'a la fin de tes produits
je t'xplique si le contenu de postXX existe je contatene à la chaine mailexpe precedente et je rajoute un retour chariot à la fin (chr(10) )
Y'a mieux pour faire ce que tu veut , mais si tu est pas un fan de php ca ca devrais suffire
ensuite tu appelle ta fonction pour envoyer le mail comme ça
si tu est en local n'oublie pas de verifier dans ton php.ini que la partie mail estcorectement configurée
par defaut smtp est a localhost, donc la tu modifie localhost par ton smtp,si t'est chez orange ce sera smtp.orange.fr, chez free smtp.free.fr etc... redemarre le serveur et hop
tu a quoi comme erreur?
pour la fonction mail essaie ça
function envoimail_html($to,$from,$sujet,$contenu,$titre) { /*$to adresse a laquelle tu veut envoyer le mail $from d'ou est parti le mail $contenu le message complet */ $JOUR = date("d/m/Y"); $HEURE = date("H:i"); $subject=$sujet.chr(10).'Le '.$JOUR.' a : '.$HEURE; $headers = "MIME-Version: 1.0 \n"; $headers .= "Content-type: text/html; charset=iso-8859-1 \n"; $headers .= "From: $from \n"; //accuse de reception //$headers .= "Disposition-Notification-To: $from \n"; // Message de Priorité haute // ------------------------- $headers .= "X-Priority: 1 \n"; $headers .= "X-MSMail-Priority: High \n"; $mail_Data = ""; $mail_Data .= "<html> \n"; $mail_Data .= "<head> \n"; $mail_Data .= "<title> $titre </title> \n"; $mail_Data .= "</head> \n"; $mail_Data .= "<body>\n"; $mail_Data .= "<span style=" color:#FF0000; font-weight:bold;"> $sujet </span>> <br/> \n"; $mail_Data .= ' <br/><div align="center" style="font:\'Times New Roman\', Times, serif; color:#003399;">'.$contenu.' <br/></div>'; $mail_Data .= "</body> \n"; $mail_Data .= "</html> \n"; $etat_mail = TRUE; $etat_mail = @mail ($to, $subject, $mail_Data, $headers); if ($etat_mail === FALSE) { return false; } else { return true; } }
en ce qui concerne tes variable recuperees par post la y a un truc que je pige pas
if ($_POST['47'] != '') { $mailaexp = $mailaexp.'Vêtement lin et soie = '.$_POST['47'].' ; '; }
pourquoi tu met = et apres encore = ????
je vais te donner un exemple, avant de commencer a concatener recupere tes variable
//je declare la variable $mailexp à vide
$mailaexp = ''; if(isset($_POST[01]) ) { $mailaexp .= 'Individuel 2€ '.$_POST[02].chr(10); } else if(isset($_POST[02]) ) { $mailaexp .= 'A partir de 5 pers – 1.00 € / pers '.$_POST[02].chr(10); }
etc... jusqu'a la fin de tes produits
je t'xplique si le contenu de postXX existe je contatene à la chaine mailexpe precedente et je rajoute un retour chariot à la fin (chr(10) )
Y'a mieux pour faire ce que tu veut , mais si tu est pas un fan de php ca ca devrais suffire
ensuite tu appelle ta fonction pour envoyer le mail comme ça
$email = isset($_POST['email']) ? $_POST['email'] : null; //uniquement si il y a une adresse email if(isset($email) && !empty($email)) { $to=$email; $from='ton adresse'; $sujet='sujet'; $titre='ce que tu veut, ca peut meme etre vide'; envoimail_html($to,$from,$sujet,$mailaexp ,$titre) } else { echo'Vous n'avez pas mis d\'adresse mail'. }
si tu est en local n'oublie pas de verifier dans ton php.ini que la partie mail estcorectement configurée
par defaut smtp est a localhost, donc la tu modifie localhost par ton smtp,si t'est chez orange ce sera smtp.orange.fr, chez free smtp.free.fr etc... redemarre le serveur et hop