1 2 3 4 5 6 7 8 9 10 11 12 13 14
| if(createMail($_POST['name'],$_POST['soc'],$_POST['adr'],$_POST['tel'],$_POST['mail'],$_POST['text'])){
echo '<p>Votre demande a bien été envoyé.</p>';
}
function createMail($name, $soc, $adr, $tel, $mail, $text){
$to = "informatique@xxxxxxxxxxxx.com";
$subject = "TEST";
$message = "Demande effectuée par ".$name." \r\n Informations :".$text."\r\n Coordonnées : \r\n Société : ".$soc." \r\n Adresse : ".$adr." \n Téléphone : ".$tel." \n Email : ".$mail;
$headers = 'From: '.$name. "\r\n" .
'Reply-To: xxxxxxx@xxxxxx.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
} |