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
|
<html>
<head>
<title>Email</title>
</head>
<body>
<?
if (isset($_POST['upload']))
{
if ($nom == "(facultatif)" OR $nom == "") { $nom = "?"; }
if ($email == "(facultatif)" ) { $email = ""; }
if ($objet == "(facultatif)" ) { $objet = "Un email depuis le site web !"; }
if ($message == "Merci!" ) { $message = ""; }
if ($email != "" && (eregi("^[_\.0-9a-z-]+@([0-9a-z-]+\.)+[a-z]{2,4}$",$email)==false) ) { echo "<b>Email non valide !</b>"; }
elseif ( $message == "" && $fichier == "") { echo "<b>Il n'y a pas de message !</b>"; }
elseif ( $fichier != "" && file_exists("Upload/Mails/".$_FILES['fichier']['name'])) { echo "<b>Renommer la pièce jointe !</b>"; }
elseif ( $fichier != "" && !move_uploaded_file($_FILES['fichier']['tmp_name'],"Upload/Mails/".$_FILES['fichier']['name'])) { echo "<b>Echec avec la pièce jointe !</b>"; }
elseif ( $code != $rand) { echo "<b>Code incorrect !</b>"; }
else
{ if ($fichier == "") { $message = "<html>\n<body>\nNom: ".$nom."<br><br>\n".$message."\n</body>\n</html>"; }
else
{
$message = "<html>\n<body>\nNom: ".$nom."<br><br>\n".$message."<br><br>\nPJ: ".
"<a href=\"ftp://XXXXXXXX/Upload/Mails/".$_FILES['fichier']['name']."\">".$_FILES['fichier']['name']."</a> (Ftp) ou: ".
"<a href=\"XXXXXXXX/Upload/Mails/".$_FILES['fichier']['name']."\">".$_FILES['fichier']['name']."</a> (Http)\n</body>\n</html>";
}
if ($email == "") { mail("xxxxxxxxxxx",$objet,$message,"X-priority:".$priorite."\nContent-type:text/html\nFrom:xxxxxxxxxxxxxx\n"); }
else { mail("xxxxxxxxxxxxxx",$objet,$message,"X-priority:".$priorite."\nContent-type:text/html\nFrom:xxxxxxxxxxxxx\nReply-to:$email\n"); }
echo "<b>Votre message est bien parti !</b>";
} // fin de else
} // fin de if
?>
<!-- <form method="POST" enctype="multipart/form-data" action="Envoie_mail.php" name="formulaire" target="popup" onsubmit="javascript:window.open('','popup','directories=0, menuBar=0, status=0, location=0, scrollbars=0, resizable=0, width=370, height=100, top=50, left=50');"> -->
<form method="POST" enctype="multipart/form-data" action="Email.php">
<table width="70%" border="1" rules="none">
<tr>
<td>Votre Nom</td>
<td><input name="nom" type="text" size="40" maxlength="30" value="(facultatif)" title="30 caractères maxi" onfocus="this.style.backgroundColor='#fff9b9'; if (value=='(facultatif)') {value=''}" onblur="this.style.backgroundColor=''; if (value=='') {value='(facultatif)'}" ></td>
</tr>
<tr>
<td>Votre email</td>
<td><input name="email" type="text" size="40" maxlength="30" value="(facultatif)" title="30 caractères maxi" onfocus="this.style.backgroundColor='#fff9b9'; if (value=='(facultatif)') {value=''}" onblur="this.style.backgroundColor=''; if (value=='') {value='(facultatif)'}" ></td>
</tr>
<tr>
<td>Objet</td>
<td><input name="objet" type="text" size="40" maxlength="30" value="(facultatif)" title="30 caractères maxi" onfocus="this.style.backgroundColor='#fff9b9'; if (value=='(facultatif)') {value=''}" onblur="this.style.backgroundColor=''; if (value=='') {value='(facultatif)'}" ></td>
</tr>
<tr>
<td>Priorité</td>
<td>
<select name="priorite" size="1" id="priorite">
<option value="1" style="color:#ffffff;background-color:#000066">Maximale</option>
<option value="2" style="color:#ffffff;background-color:#0000CC">Elevée</option>
<option value="3" style="color:#000000;background-color:#9999FF" selected>Normale</option>
<option value="4" style="color:#000000;background-color:#CCCCFF">Faible</option>
<option value="5" style="color:#000000;background-color:#CCFFFF">Minimale</option>
</select>
</td>
</tr>
<tr>
<td><br><br>Message...<br><img src="Images/clavier.gif" border="0" onmouseover="this.className='FlipH'" onmouseout="this.className=''"></td>
<td><textarea name="message" cols="55" rows="8" wrap="PHYSICAL"></textarea></td>
</tr>
<tr>
<td>Pièce jointe</td>
<td><input type="file" name="fichier" size="56" title="Quelques Mo maxi" onfocus="this.style.backgroundColor='#fff9b9'" onblur="this.style.backgroundColor=''" ></td>
</tr>
<tr>
<td>Code : <b><? $rand = rand(100000,1000000); echo $rand; ?></b></td>
<td><input name="code" type="text" size="30" maxlength="6" value="(recopier le code ci-contre)" title="sécurité anti robot" onfocus="this.style.backgroundColor='#fff9b9'; if (value=='(recopier le code ci-contre)') {value=''}" onblur="this.style.backgroundColor=''; if (value=='') {value='(recopier le code ci-contre)'}" ></td>
</tr>
</table>
<input type="submit" name="upload" value="Envoyez" class="bouton" onMouseOver="this.className='boutonOVER';" onMouseOut="this.className='boutonOUT';" >
<input type="reset" value="Effacer" class="bouton" onMouseOver="this.className='boutonOVER';" onMouseOut="this.className='boutonOUT';" >
</form>
</body>
</html> |
Partager