IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

Php envoi de mail


Sujet :

PHP & Base de données

  1. #1
    Membre habitué
    Profil pro
    Inscrit en
    Octobre 2009
    Messages
    480
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2009
    Messages : 480
    Points : 164
    Points
    164
    Par défaut Php envoi de mail
    Bonjour,

    J'utilise ce code pour envoyer le contenu d'un formulaire... mais depuis un certain temps maintenant la partie CONFIRMATION ne fonctionne plus ??? Et cela fonctionnait avant, j'ai certainement modifié un truc mais quoi ?

    Pouvez-vous m'aider ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Refresh" content="0.1;URL=../Confirm_Commande_choco2023.html">
    <title>Envoie du mail</title>
     
    </head>
    <body>
    	<?php
    	$nom=$_POST['nom']; 
    	$prenom=$_POST['prenom']; 
    	$adresse=$_POST['adresse'];
    	$cp=$_POST['cp'];
    	$chercher=$_POST['chercher'];
    	$livrer=$_POST['livrer'];
    	$localite=$_POST['localite'];
    	$mail=$_POST['mail']; 
    	$jsep=$_POST['jsep']; 
    	$tel=$_POST['tel'];
    	$texte=$_POST['texte'];
    	$e2=$_POST['e2'];
    	$p2=$_POST['p2'];
    	$somme2=$_POST['somme2'];
    	$somme3=$_POST['somme3a'];
    	$somme4=$_POST['somme4a'];
    	$province=$_POST['province'];
     
    	$chercher2="";
    	$livrer2="";
     
    	if ($chercher =="Oui") {
    			$chercher2 = "Je viendrai chercher le chocolat au dépôt.";
    		}
    	if ($livrer =="Oui") {
    			$livrer2 = "Je demande que le chocolat me soit livré (gratuit pour les affiliés !)";
    		}
     
     
    		if ($province =="Namur") {
    			$toemail = 'aaaa@lki01.be';
    		}
    		if ($province =="Brabant Wallon") {
    			$toemail = 'aaaa@lki01.com';
    		}
    		if ($province =="Liège") {
    			$toemail = 'aaaa@lki021.be';
    		}
    		if ($province =="Bruxelles") {
    			$toemail = 'aaaa@lki201.be';
    		}
    		if ($province =="Luxembourg") {
    			$toemail = 'aaa7a@lki01.fr';
    		}
    		if ($province =="Hainaut OUEST") {
    			$toemail = 'aaaa@lkiukuk01.be, gtgtgg@ml.be';
    		}
    		if ($province =="Hainaut EST") {
    			$toemail = 'aaagttga@lki01';
    		}
    		if ($province =="CHOIX") {
    			$toemail = 'aaargrgrga@lki01';
    		}
     
     
     
    	    $email = $toemail; // c'est la personne qui recevra le message !
    		$copie = 'aaaa@lkittg01.be, atggtgtgaa@lki01.be';
    		$email_reply = $toemail; // c'est la personne qui recevra le réponse !
    		$sujet = 'Commande vendeur CHOCO - Site Internet';
     
    		$from = 'Opération Choco'; // c'est le nom du contact qui sera affiché
    		$from_mail = $mail; // c'est l'adresse à partir de laquelle le mail est envoyé, veillez à ce que l'adresse existe bien
    		/////voici la version Mine 
    		$headers = 'Mime-Version: 1.0'."\r\n";
    		$headers .= 'Content-type: text/html; charset=utf-8'."\r\n";
    		$headers .= 'Cc: '.$copie."\n"; // Copie Cc
    		$headers .= 'From: "COMMANDE VENDEUR CHOCO"<'.$mail.'>'."\n"; 
    		$body= "
    		
    		<font color='#990033'>COMMANDE VENDEUR CHOCO
    		<br />============================== $province</font>
    		<br />
    		<br /><b>Informations :
    		<br />--------------------</b>
    		<br /><b><font color='#006393' size='+4'>$nom $prenom,</font></b>
    		<br />Adresse: $adresse
    		<br />Code postal / Localité: $cp $localite
    		<br />E-mail: $mail
    		<br />Téléphone/Gsm: $tel
    		<br />J'ai la SEP: $jsep
    		<br />
    		<br /><b>$chercher2</b>
    		<br /><b>$livrer2</b>
    		<br />
    		<br /><b>Commande :
    		<br />------------------</b>
    		<br /><b>ÉCRIN (Quantité)</b>
    		<br />* 10€ l'écrin (par tranche de 11 !) : <b>	$e2</b>
    		<br />
    		<br /><b>POCKETS (Quantité)</b>
    		<br />* 7€ le pocket (par tranche de 12 !) : <b>$p2</b>
    		<br />
    		<br />TOTAL :		 <b><font color='#006393' size='+2'>	$somme4 €</font></b>
    		<br />FRAIS DE LIVRAISON : <b><font color='#006393' size='+2'>	$somme3 €</font></b>
    		<br />A PAYER :		 <b><font color='#006393' size='+2'>	$somme2 €</font></b>
    		<br />
    		<br /><b>Texte :
    		<br />--------- </b>
    		<br /><i>$texte</i>
    		<br />	
    		<br />
    		<br />
    		<img src='http://ligjuyjyujep.be/chocojuyjyujyclef2/formjuyjuyulaire_php/imuyges/logo_choco;:li:.png' width='300' height='131' alt='Logo CHOCOCLEF'/><br />
    		<font color='#666666'>Lijs - CommunL - v2023</font>
    		"; 
    		mail($email,$sujet,$body,$headers);
     
     
     
     
    	    $email = $mail; // c'est la personne qui recevra le message !
    		$copiei = 'fohnnhnhn@linhuij.be';
    		$email_reply = $toemail; // c'est la personne qui recevra le réponse !
    		$sujet = 'Confirmation Commande CHOCO - Site Internet';
     
    		$from = 'Opération Chococlef - LBSP-CF'; // c'est le nom du contact qui sera affiché
    		$from_mail = $mail; // c'est l'adresse à partir de laquelle le mail est envoyé, veillez à ce que l'adresse existe bien
    		/////voici la version Mine 
    		$headers = 'Mime-Version: 1.0'."\r\n";
    		$headers .= 'Content-type: text/html; charset=utf-8'."\r\n";
    		$headers .= 'Cci: '.$copiei."\n"; // Copie Cci
    		$headers .= 'From: "CONFIRMATION COMMANDE CHOCO"<'.$mail.'>'."\n"; 
    		$body= "
    		
    		<font color='#990033'>CONFIRMATION COMMANDE CHOCO
    		<br />===================================== $province</font>
    		<br />
    		<br /><b>Informations :
    		<br />--------------------</b>
    		<br /><b><font color='#006393' size='+4'>$nom $prenom,</font></b>
    		<br />Adresse: $adresse
    		<br />Code postal / Localité: $cp $localite
    		<br />E-mail: $mail
    		<br />Téléphone/Gsm: $tel
    		<br />J'ai la SEP: $jsep
    		<br />
    		<br /><b>$chercher2</b>
    		<br /><b>$livrer2</b>
    		<br />
    		<br /><b>Commande :
    		<br />------------------</b>
    		<br /><b>ÉCRIN (Quantité)</b>
    		<br />* 10€ l'écrin (par tranche de 11 !) : <b>	$e2</b>
    		<br />
    		<br /><b>POCKETS (Quantité)</b>
    		<br />* 7€ le pocket (par tranche de 12 !) : <b>$p2</b>
    		<br />
    		<br />TOTAL :		 <b><font color='#006393' size='+2'>	$somme4 €</font></b>
    		<br />FRAIS DE LIVRAISON : <b><font color='#006393' size='+2'>	$somme3 €</font></b>
    		<br />A PAYER :		 <b><font color='#006393' size='+2'>	$somme2 €</font></b>
    		<br />
    		<br /><b>Texte :
    		<br />--------- </b>
    		<br /><i>$texte</i>
    		<br />	
    		<br />
    		<br />
    		<font color='#990033'>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    		<br />VOUS ALLER ETRE CONTACTÉ POUR VALIDATION !
    		<br />~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Merci :-)</font>	
    		<br />
    		<br />
    		<br />
    		<img src='http://ligte.be/chocof2/formjuyire_php/imjuyges/logo_choco40.png' width='300' height='131' alt='Logo CHOCO/><br />
    		<font color='#666666'>Ligu</font>
    		";
    		mail($email,$sujet,$body,$headers);
     
    	?>
    </body>
    </html>
    Merci :-)

  2. #2
    Membre habitué
    Profil pro
    Inscrit en
    Octobre 2009
    Messages
    480
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2009
    Messages : 480
    Points : 164
    Points
    164
    Par défaut
    Personne... ?

    EDIT:
    J'ai trouvé, j'avais un problème avec cette ligne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    mail($email,$sujet,$body,$headers);

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. php envoi de mail boundary
    Par splifferwolf dans le forum Langage
    Réponses: 3
    Dernier message: 23/11/2015, 09h29
  2. Souci PHP envoi de mail
    Par Invité dans le forum PHP & Base de données
    Réponses: 1
    Dernier message: 18/09/2012, 23h42
  3. PHP envoi de mail
    Par T4GAD4 dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 10
    Dernier message: 04/07/2012, 09h55
  4. Réponses: 3
    Dernier message: 22/02/2010, 13h43
  5. php envoie de mail
    Par pratheep dans le forum PHP & Base de données
    Réponses: 3
    Dernier message: 02/06/2009, 17h14

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo