boutils 9 anni fa
parent
commit
c890ae5603
1 ha cambiato i file con 7 aggiunte e 10 eliminazioni
  1. 7 10
      ajax/datastores.php

+ 7 - 10
ajax/datastores.php

@@ -43,26 +43,23 @@ if(isset($_POST['mail'])) {
   $email = 'ftth@manchenumerique.fr';
   $bcc   = 'ftth@manchenumerique.fr';
 
-  $headers  = "";
-  $headers .= "From: Manche Numerique <".$email."> \r\n";
-  $headers .= "Reply-To:" . $email . "\r\n" ."X-Mailer: PHP/" . phpversion();
-  $headers .= 'MIME-Version: 1.0' . "\r\n";
-  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
-  $headers .= 'Bcc: '.$bcc."\r\n";
-
   if(isset($_POST['siteEmail'])) {
     $email = $_POST['siteEmail'];
   }
 
-  // En-têtes additionnels
-  $headers .= utf8_decode('From: Manche Numérique').' <'.$email.'>' . "\r\n";
+  $headers  = "";
+  $headers .= "Reply-To:".$email."\r\n"."X-Mailer: PHP/".phpversion(). "\r\n";
+  $headers .= "MIME-Version: 1.0"."\r\n";
+  $headers .= "Content-type: text/html; charset=iso-8859-1"."\r\n";
+  $headers .= "Bcc: ".$bcc."\r\n";
+  $headers .= "From: ".utf8_decode("Manche Numérique")." <".$email.">"."\r\n";
 
   $subject = utf8_decode($_POST['mail']['sujet']);
   $subject = mb_encode_mimeheader($subject, "UTF-8");
 
   // Envoi
   $to = $_POST['mail']['to'];
-  $resultat = mail($to, $subject, utf8_decode($_POST['mail']['message']), $headers);
+  $resultat = mail($to, $subject, utf8_decode($_POST['mail']['message']), $headers, "-f ".$email);
 }
 
 if(isset($resultat)){