J'ai trois fichiers:
show_form.php
mail.php
config.inc.php
Peut on faire changer ce script et comment de maniere que puisse envoyer de que des photos (.jpg .gif ...)
config.inc.php
CODE
<?php
$sendmail='mail_AT_adresse.com';
$sendtheme=MESSAGE Via ton site';
$sendchar='windows-1250';
$username='koko';
$password='koko';
?>
$sendmail='mail_AT_adresse.com';
$sendtheme=MESSAGE Via ton site';
$sendchar='windows-1250';
$username='koko';
$password='koko';
?>
Dan ce fichier show_form.php
il y a ça: (j'ai pas tout mis), si non ça fait 190 pages.
CODE
<table>
<form action="mail.php" name="mailform" method="post" target="sendmail">
<tr>
<td> <font style="font-size:13;">
<input type="text" maxlength=130 id="sn" name="sendernm" class="inpmail" style="width:80;" value="[votre nom]" onClick="clearmailform(sn)">
</td>
<td> <font style="font-size:13;">
<input type="text" maxlength=130 id="sm" name="senderml" class="inpmail" style="width:170;" value="[votre adresse E-mail]" onclick="clearmailform(sm);">
</td>
</tr>
<tr>
<td colspan=2> <textarea name="senderbody" class="inpmail" style="width:255;height:100;text-align:justify;"></textarea>
<br> </td>
</tr>
<tr>
<td colspan=2> <div align="center">
<input type="reset" value="ANNULER" class="inpmail" style="font-family: Arial,Verdana,Helvetica;font-size: 13px; color:#cccccc;font-weight:bold;background-color: #5E514A;">
<input name="submit" type="submit" class="inpmail" style="font-family: Arial,Verdana,Helvetica;font-size: 13px; color:#cccccc;font-weight:bold;background-color: #5E514A;" onClick="sendmail=window.self('','sendmail','width=300,height=100,top=0,left=0,titlebar=no,toolbar=no,location=no,status=
o,menubar=no,scrollbars=no,resizable=no',target='_self');sendmail.document.write('<b><br><br><br>Message is sending ...</b>');" value="ENVOYER">
</div></td>
</tr>
</form>
</table>
<form action="mail.php" name="mailform" method="post" target="sendmail">
<tr>
<td> <font style="font-size:13;">
<input type="text" maxlength=130 id="sn" name="sendernm" class="inpmail" style="width:80;" value="[votre nom]" onClick="clearmailform(sn)">
</td>
<td> <font style="font-size:13;">
<input type="text" maxlength=130 id="sm" name="senderml" class="inpmail" style="width:170;" value="[votre adresse E-mail]" onclick="clearmailform(sm);">
</td>
</tr>
<tr>
<td colspan=2> <textarea name="senderbody" class="inpmail" style="width:255;height:100;text-align:justify;"></textarea>
<br> </td>
</tr>
<tr>
<td colspan=2> <div align="center">
<input type="reset" value="ANNULER" class="inpmail" style="font-family: Arial,Verdana,Helvetica;font-size: 13px; color:#cccccc;font-weight:bold;background-color: #5E514A;">
<input name="submit" type="submit" class="inpmail" style="font-family: Arial,Verdana,Helvetica;font-size: 13px; color:#cccccc;font-weight:bold;background-color: #5E514A;" onClick="sendmail=window.self('','sendmail','width=300,height=100,top=0,left=0,titlebar=no,toolbar=no,location=no,status=
o,menubar=no,scrollbars=no,resizable=no',target='_self');sendmail.document.write('<b><br><br><br>Message is sending ...</b>');" value="ENVOYER">
</div></td>
</tr>
</form>
</table>
mail.php
CODE
<?php
include("data/config.inc.php");
if($_POST['senderml']=="" or $_POST['senderml']=="[Votre boite]") {
$mess="Vous devez indiquer votre <u>Adresse E-mail</u>!"; $title="Erreur!";
} elseif(!strstr($_POST['senderml'],"@") or !strstr($_POST['senderml'],".")) {
$mess="Votre adresse <u>exacte</u> est nécéssaire pour l'envoi de votre message."; $title="Erreur!";
} elseif (!isset($_POST['senderbody']) or $_POST['senderbody']=="") {
$mess="Votre <u>message est nécéssaire</u> pour effectuer l'envoi de cette lettre..."; $title="Erreur!";
} else {
if(!isset($_POST['sendernm']) or $_POST['sendernm']=="[Votre nom]") $_POST['sendernm']="anonymous";
$body=strip_tags($_POST['senderbody']);
$headers ="From: ".strip_tags($_POST['sendernm'])."<".strip_tags($_POST['senderml']).">\n";
$headers.="X-Sender: TSB Mailer\n";
$headers.="Content-Type: text/html; charset=".$sendchar;
$sign=array("\r","\n");
$ch=array("","");
mail($sendmail,$sendtheme,$body,$headers);
$his_f=fopen("data/history.txt","a+");
fputs($his_f,"\n".mktime().":|:".strip_tags($_POST['sendernm']).":|:".strip_tags($_POST['senderml']).":|:".str_replace($sign,$ch,strip_tags($_POST['senderbody'])));
fclose($his_f);
$mess="<font color='#cccccc' size='2'><br><br><br><br>Votre message a été envoyé avec succes!<br>Merci.</font>"; $title="Message envoyé avec succes!"; $sent="ok";
}
?>
include("data/config.inc.php");
if($_POST['senderml']=="" or $_POST['senderml']=="[Votre boite]") {
$mess="Vous devez indiquer votre <u>Adresse E-mail</u>!"; $title="Erreur!";
} elseif(!strstr($_POST['senderml'],"@") or !strstr($_POST['senderml'],".")) {
$mess="Votre adresse <u>exacte</u> est nécéssaire pour l'envoi de votre message."; $title="Erreur!";
} elseif (!isset($_POST['senderbody']) or $_POST['senderbody']=="") {
$mess="Votre <u>message est nécéssaire</u> pour effectuer l'envoi de cette lettre..."; $title="Erreur!";
} else {
if(!isset($_POST['sendernm']) or $_POST['sendernm']=="[Votre nom]") $_POST['sendernm']="anonymous";
$body=strip_tags($_POST['senderbody']);
$headers ="From: ".strip_tags($_POST['sendernm'])."<".strip_tags($_POST['senderml']).">\n";
$headers.="X-Sender: TSB Mailer\n";
$headers.="Content-Type: text/html; charset=".$sendchar;
$sign=array("\r","\n");
$ch=array("","");
mail($sendmail,$sendtheme,$body,$headers);
$his_f=fopen("data/history.txt","a+");
fputs($his_f,"\n".mktime().":|:".strip_tags($_POST['sendernm']).":|:".strip_tags($_POST['senderml']).":|:".str_replace($sign,$ch,strip_tags($_POST['senderbody'])));
fclose($his_f);
$mess="<font color='#cccccc' size='2'><br><br><br><br>Votre message a été envoyé avec succes!<br>Merci.</font>"; $title="Message envoyé avec succes!"; $sent="ok";
}
?>
Merci d'avance