5/5 (27 avis)
Snippet vu 21 695 fois - Téléchargée 31 fois
'formulaire d'envoie' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Contact</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style> BODY { SCROLLBAR-FACE-COLOR:#ffffff; SCROLLBAR-HIGHLIGHT-COLOR: #B6B6B6; SCROLLBAR-SHADOW-COLOR:#B6B6B6; SCROLLBAR-3DLIGHT-COLOR: #F2F2F2; SCROLLBAR-ARROW-COLOR: #B6B6B6 SCROLLBAR-TRACK-COLOR: #B6B6B6; SCROLLBAR-DARKSHADOW-COLOR:#B6B6B6; background-image: url(); } </style> <style type="text/css"> <!-- <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 2px; margin-right: 0px; margin-bottom: 0px; background-image: url(gif/bg2.gif); } .normal { font-size : 11pt; padding-right : 10pt; font-weight : normal; left: 5pt; padding-top: 10pt; padding-bottom: 10pt; padding-left: 10pt; } --></style> <link href="css/txt.css" rel="stylesheet" type="text/css"> <link href="css/txtplus.css" rel="stylesheet" type="text/css"> <link href="style.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- .Style4 {font-size: 11px} .style13 {color: #99CC00} .style14 { color: #FFFFFF; font-weight: bold; } .style34 {font-size: 11px; font-style: normal; line-height: normal; font-weight: normal; font-variant: normal; text-transform: capitalize; text-decoration: none; font-family: "Century Gothic";} .style35 {font-size: 14px; font-style: normal; font-weight: bold; font-variant: bold; text-decoration: none; font-family: Geneva, Arial, Helvetica, san-serif;} .style6 {font-family: Geneva, Arial, Helvetica, san-serif; font-weight: bold; color: #FFFFFF; font-size: 14px; } .style7 {font-family: Geneva, Arial, Helvetica, san-serif} .style36 {font-size: 12px} .style39 { font-family: Geneva, Arial, Helvetica, san-serif; font-size: 12px; font-weight: bold; color: #006699; } .style41 {color: #006699} .style45 {font-family: Geneva, Arial, Helvetica, san-serif; font-size: 12px; font-weight: bold; color: #999999; } .style48 {font-family: Geneva, Arial, Helvetica, san-serif; font-size: 12px; font-weight: bold; } .style51 {color: #666666} .style53 {font-family: Geneva, Arial, Helvetica, san-serif; font-size: 12px; font-weight: bold; color: #666666; } .style54 {color: #666666; font-weight: bold; } .style58 {color: #000000} --> </style> </head> <body bgcolor="#FFFFFF" text="#000000" leftMargin="0" topMargin="0" marginwidth="0" marginheight="0" rightmargin="0" > <strong><font color="#FF9900"><span class="txtplus"><font color="#003366"><strong><font color="#FF9900"><font color="#003366"></font></font></strong></font></span></font></strong> <table width="654" height="336" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="298" height="19" bgcolor="#3F8420"> <span class="style6"><span class="style13">>></span><span class="style14"><span class="style34"><span class="style35">Contact</span></span></span> : <strong><font color="#FF9900"><span class="txtplus"><font color="#003366"><strong><font color="#FF9900"><font color="#003366"></font></font></strong></font></span></font></strong></span></td> <td width="124" bgcolor="#EEEEEE"><img src="imgs/tab.jpg" width="57" height="19"></td> <td width="232" bgcolor="#EEEEEE"><span class="style7"></span></td> </tr> <tr align="left" valign="top"> <td height="317" colspan="5" background="imgs/index_04.jpg"><blockquote> <form action="mail.php" method="post" name="form1"> <p align="center"> </p> <table width="172" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td width="172" bgcolor="#E2E2E2"><span class="style36 style7 style41"><strong><img width="7" height="10" src="competences_clip_image001_0001.gif"><span class="style58">Tunisie : </span></strong></span></td> </tr> <tr> <td><span class="style45">Tél : +</span></td> </tr> <tr> <td height="19"><span class="style45">Fax : +</span></td> </tr> <tr> <td height="19"><span class="style45">Adresse:7,Av Taieb M'hiri</span></td> </tr> <tr> <td height="19"><div align="left"><span class="style45"> Ariana 2080 Tunisie</span></div></td> </tr> <tr> <td bgcolor="#E2E2E2"><span class="style39"><img width="7" height="10" src="competences_clip_image001_0001.gif"><span class="style58">France : </span></span></td> </tr> <tr> <td><span class="style45">Tél :<FONT face=Arial><SPAN style="FONT-FAMILY: Arial">+<o:p></o:p></SPAN></FONT></span></td> </tr> <tr> <td><span class="style45">Fax :<FONT face=Arial><SPAN style="FONT-FAMILY: Arial">+</SPAN></FONT></span></td> </tr> <tr> <td class="style45"><div align="left"> <p align="justify">Adresse:<span class="MsoNormal"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 8-10</SPAN></FONT></span>,Chemin Saint Gobain 69 190 -Saint-Fons Lyon- France </p> </div></td> </tr> <tr> <td height="15" bgcolor="#E2E2E2" class="style48"><p><img width="7" height="10" src="competences_clip_image001_0001.gif">Commerial </p> </td> </tr> <tr> <td><span class="style48"><a href="mailto:commercial@ascii-web.com" target="_blank"><span class="style54"> </span></a><span class="style51"></span></span></td> </tr> <tr> <td bgcolor="#E2E2E2"><span class="style48"><img width="7" height="10" src="competences_clip_image001_0001.gif">Technique : <span class="style51"></span></span></td> </tr> <tr> <td><span class="style48"><a href="mailto:support@ascii-web.com " target="_blank"><span class="style54">support@ascii-web.com </span></a> <span class="style51"></span></span></td> </tr> </table> <table width="303" border="0" align="center" cellpadding="0" cellspacing="0"> <tr bgcolor="#F2F9FF"> <td width="73"><div align="right" class="style53">Nom:</div></td> <td width="218"><input type="text" name="nom"></td> </tr> <tr> <td><div align="right" class="style53">Prénom:</div></td> <td><input type="text" name="prenom"></td> </tr> <tr bgcolor="#F2F9FF"> <td><div align="right" class="style53">Société:</div></td> <td><input type="text" name="societe"></td> </tr> <tr> <td><div align="right" class="style53">E-mail:</div></td> <td><input type="text" name="mail"></td> </tr> <tr bgcolor="#F2F9FF"> <td><div align="right" class="style53">Tél:</div></td> <td><input type="text" name="tel"></td> </tr> <tr> <td><div align="right" class="style53">Fax:</div></td> <td><input type="text" name="fax"></td> </tr> <tr bgcolor="#F2F9FF"> <td valign="top"><div align="right" class="style53">Message:</div></td> <td><textarea name="message" cols="30" rows="3"></textarea> </td> </tr> <tr bgcolor="#FFFFFF"> <td valign="top"><div align="right" class="style53">Pièce Jointe:</div></td> <td valign="top"> <input type="file" name="fileattach" value=""></td> </tr> <tr bgcolor="#FFFFFF"> <td height="26" colspan="2"><div align="center"> <input type="reset" name="Reset" value="Annuler"> <input type="submit" name="Submit2" value="Envoyer"> </div></td> </tr> </table> </form> </blockquote></td> </tr> </table> <strong><font color="#FF9900"><span class="txtplus"><font color="#003366"><strong><font color="#FF9900"><font color="#003366"></font></font></strong></font></span></font></strong> </body> </html> ///////////////////////////////// page mail.php <?php include "libmail.php"; $nom = $_POST['nom']; $prenom = $_POST['prenom']; $societe = $_POST['societe']; $mail = $_POST['mail']; $tel = $_POST['tel']; $fax = $_POST['fax']; $message = $_POST['message']; $fileattach = $_POST['fileattach']; $sujet="Test de mail"; $msg="prénom:$prenom \n nom:$nom \n société:$societe \n mail:$mail \n tel:$tel \n fax:$fax \n message: \n $message"; $m = new mail(); // create the mail $m->From("webmaster"); $m->To("mouajria@yahoo.fr"); $m->Subject( "Mail Envoyé à partir du site " ); $m->Body($msg); $m->Priority(4); $patharray = explode ("\\", $fileattach); $FileName=$patharray[count($patharray)-1]; echo $FileName; if ("$FileName"!="") { if (is_uploaded_file($HTTP_POST_FILES['fileattach'])) { copy($HTTP_POST_FILES['fileattach'], "../upload/$FileName"); $m->Attach("../upload/$FileName"); } else { echo "Tentative d'attaque possible : '$HTTP_POST_FILES[fileattach]'."; } //echo $FileName; } $m->Send(); if ("$FileName"!="") { Unlink("../upload/$FileName"); } echo "le mail a éte envoyé "; ?> ///////////////////////////la clsse libmail fichier : libmail.php <?php class Mail { /* list of To addresses @var array
2 janv. 2008 à 22:17
7 déc. 2005 à 11:13
Vous disez que ce script fonctionne.Mais moi je pense pas votre script n'envoie pas le mail. j'ai modifier php.in de cette façon:
SMTP = smtp.mail.yahoo.fr;
smtp_port = 25
sendmail_from= k_zied33@yahoo.com;
Bon je ne sais pas ou est le probleme dans ma configuration SMTP ou dans votre script.
Si vous pouvez dés que vous lisez ce msg me repondre sur mon mail k_zied33@yahoo.com ou k.zied2@voila.fr .
S'il voous plais j'ai besoin de se enre de scripte.Aidez moi.
Merci.
26 oct. 2005 à 17:36
j'ai essayé même aprés etre corrigé mais ca ne marche pas l'attachement du fichier et voici l'erreur :
Notice: Undefined index: fileattach in c:\program files\easyphp1-8\www\mail3\mail.php on line 27
Notice: Undefined index: fileattach in c:\program files\easyphp1-8\www\mail3\mail.php on line 31
Tentative d'attaque possible : ''.
Warning: unlink(../upload/chiffre.jpg): No such file or directory in ....................ligne 38
4 oct. 2005 à 10:16
Est-ce que quelqu'un a trouvé une solution ?
30 sept. 2005 à 16:14
pouvez vous m'aider?
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.