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
| <?php
$sujet = $_POST['sujet'];
$priorite = $_POST['priorite'];
$titre = $sujet." ".$priorite;
$salarie = $_POST['salarie'] ;
$date = $_POST['date'] ;
$societe = $_POST['societe'] ;
$nom = $_POST['nom'] ;
$tel = $_POST['tel'] ;
$email = $_POST['email'] ;
$objet = $_POST['objet'] ;
$qui = " ";
if (!$_POST['societe'])
{$societe = "Non renseigné";}
if (!$_POST['tel'])
{$tel = "Non renseigné";}
if (!$_POST['email'])
{$email = "Non renseigné";}
//Salarié
if ($salarie == "mail1@orange.fr")
{ $qui = "salarie1";}
if ($salarie == "mail2@orange.fr")
{ $qui = "salarie2";}
//liste email
$liste = "";
if (isset($_POST['destinataire']))
{
for ($i = 0, $c = count($_POST['destinataire']); $i < $c; $i++)
{
$liste = $liste.$_POST['destinataire'][$i].";";
}
}
//Envoi du message
$headers ='From: '.$salarie.''."\n";
$headers .='Content-Type: text/html; charset="iso-8859-1"'."\n";
$headers .='Content-Transfer-Encoding: 8bit';
$message = "
<html>
<head>
</head>
<body>
<font color='#006FB7'><strong>Message envoyé par : </strong></font> $qui <br>
<font color='#006FB7'><strong>le : </strong></font> $date <br>
<font color='#006FB7'><strong>Société : </strong></font> $societe <br>
<font color='#006FB7'><strong>Contact : </strong></font> $nom <br>
<font color='#006FB7'><strong>Téléphone : </strong></font> $tel <br>
<font color='#006FB7'><strong>Réponse par email : </strong></font> $email <br>
<font color='#006FB7'><strong>Objet du message : </strong></font> $objet <br>
</body>
</html>";
//Affichage envoi email
if (mail($liste, $titre, $message, $headers))
{// Si le mail a bien été envoyé, message de confirmation
$page = "
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'
'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<title>Envoi d'un message</title>
</head>
<body>
<table width='777' border='0' cellspacing='0' cellpadding='0' align='center'>
<tr>
<td><div align='center'>Le message a bien été envoyé aux adresses : $liste </div></td>
</tr>
</table>
</body>
</html>";
echo $page;
}
else
{// sinon, message d'erreur.
$page = "
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'
'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<title>Envoi d'un message</title>
</head>
<body>
<table width='777' border='0' cellspacing='0' cellpadding='0' align='center'>
<tr>
<td><div align='center'>Le message n'a pas été envoyé à $qui à l'adresse $salarie </div></td>
</tr>
</table>
</body>
</html>";
echo $page;}
?> |