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
| <?php
session_start();
include("cssstyle/haut.php");
include("sources/config.php");
//-----------------------------------------------
//DECLARE LES VARIABLES
//-----------------------------------------------
$destinataire=$_SESSION['email_ano'];
$nom_expediteur=$_POST['name_con'];
$phone_expediteur=$_POST['phone_con'];
$email_expediteur=$_POST['email_con'];
$com_expediteur=$_POST['comment_con'];
$sujet=$_SESSION['ref_ano'];
$email_reply=$_SESSION['email_ano'];
/*$message_texte='Ref annonce'.$sujet.''; */
$message_html='<html>
<head>
<title>H-immo</title>
</head>
<body>
<table width="361" height="203" border="0">
<tr>
<td width="83">Référence :</td>
<td width="307">'.$sujet.'</td>
</tr>
<tr>
<td>Nom :</td>
<td>'.$nom_expediteur.'</td>
</tr>
<tr>
<td>Téléphone :</td>
<td>'.$phone_expediteur.'</td>
</tr>
<tr>
<td>Email :</td>
<td>'.$destinataire.'</td>
</tr>
<tr>
<td>Message :</td>
<td>'.$com_expediteur.'</td>
</tr>
</table>
</body>
</html>';
//-----------------------------------------------
//GENERE LA FRONTIERE DU MAIL ENTRE TEXTE ET HTML
//-----------------------------------------------
$frontiere = '-----=' . md5(uniqid(mt_rand()));
//-----------------------------------------------
//HEADERS DU MAIL
//-----------------------------------------------
$headers = 'From: "Nom" <'.$email_expediteur.'>'."\n";
$headers .= 'Return-Path: <'.$email_reply.'>'."\n";
$headers .= 'MIME-Version: 1.0'."\n";
$headers .= 'Content-Type: multipart/alternative; boundary="'.$frontiere.'"';
//-----------------------------------------------
//MESSAGE TEXTE
//-----------------------------------------------
/* $message = 'This is a multi-part message in MIME format.'."\n\n";
$message .= '--'.$frontiere."\n";
$message .= 'Content-Type: text/plain; charset="iso-8859-1"'."\n";
$message .= 'Content-Transfer-Encoding: 8bit'."\n\n";
$message .= $message_texte."\n\n";*/
//-----------------------------------------------
//MESSAGE HTML
//-----------------------------------------------
$message .= '--'.$frontiere."\n";
$message .= 'Content-Type: text/html; charset="iso-8859-1"'."\n";
$message .= 'Content-Transfer-Encoding: 8bit'."\n\n";
$message .= $message_html."\n\n";
$message .= '--'.$frontiere."\n";
if(mail($destinataire,$sujet,$message,$headers))
{
echo'<script>
$(document).ready(function() {
$("#dialog").dialog({
modal: true,
opacity: .80,
});
});
setTimeout( function() {
window.location.href = ("http://www.h-immo.be/detail_anno.php?detail='.$_SESSION['detail'].'");
}, 5000 );
</script>
<div id="dialog" title=OK ENVOYER"><img src="cssstyle/imdesign/1.gif" width="24" height="24" border="0"><br />
Vous allez être rediriger
</div>';
}
else
{
echo'<script>
$(document).ready(function() {
$("#dialog").dialog({
modal: true,
opacity: .80,
});
});
setTimeout( function() {
window.location.href = ("http://www.'.$web_site.'/detail_anno.php?detail='.$_SESSION['detail'].'");
}, 5000 );
</script>
<div id="dialog" title="ERREUR ENVOIS"><img src="cssstyle/imdesign/1.gif" width="24" height="24" border="0"><br />
Vous allez être rediriger
</div>';
}
include("cssstyle/bas.php");
?> |
Partager