Du site a ma messagerie

candudu12 Messages postés 2 Statut Membre -  
 Utilisateur anonyme -
Bonjour,
j'ai un site et je voudrais que l'on puisse m'envoyer des emails sur ma
messagerie.j'ai bien fait le formulaire mais je n'arrive pas a comprendre
comment on fait pour que sa l'envoi de mon site, sur ma messagerie.
merci de me répondre rapidement et surtout simplement pour que je comprenne
A voir également:

3 réponses

smed_79 Messages postés 1793 Statut Contributeur 844
 
bonjour,

contact.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contactez-moi</title>
<style type="text/css">
BODY,TD,P,DIV,INPUT,SELECT,H1  {font-size: 10px; color: #555560;
font-family: verdana,
arial, helvetica; text-decoration: none}
</style>
</head>
<body>

<!-- Adaptation Par smed79 -->

<form method="post" action="sendemail.php">

<?php

//////////////////////////////
//  Formulaire de contact   //
//  Adaptation Par smed79   //
//////////////////////////////

$ipi = getenv("REMOTE_ADDR");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />


<b>Votre Nome :</b><br />
<input type="text" name="visitor" size="25" />
<br />
<b>Votre Email :</b><br />
<input type="text" name="visitormail" size="25" />
<br /> <br />
<b>Objet :</b> 
<select name="attn" size="1">
<option value=" Sans Objet ">Selectionner</option>
<option value=" Partenariat ">Partenariat</option>
<option value=" Suport Technic ">Suport Technic</option>
<option value=" Webmaster ">Webmaster</option>
<option value=" Autre ">Autre</option>
</select>
<br /><br />
<b>Message :</b>
<br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value=":: Send Mail ::.." />
<br />
</form>

</body>
</html>


sendemail.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contactez-moi</title>
<style type="text/css">
BODY,TD,P,DIV,INPUT,SELECT,H1  {font-size: 10px; color: #555560;
font-family: verdana,
arial, helvetica; text-decoration: none}
</style>
</head>
<body>

<!-- Adaptation Par smed79 -->

<?php

//////////////////////////////
//  Formulaire de contact   //
//  Adaptation Par smed79   //
//////////////////////////////

echo "<font color=\"red\">Message envoyer avec succes!</font>";
$ip = $_POST['ip'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$attn = $_POST['attn'];


if (eregi('http:', $notes)) {
die ("Ne tentez pas! ! ");
}
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Utilisez le lien retour et Entrez un e-mail valide</h2>\n";
$badinput = "<h2>Message Non envoyer! !</h2>\n";
echo $badinput;
die ("Go back! ! ");
}

if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Utilisez le lien retour et remplir tous les champs</h2>\n";
die ("Utilisez le lien retour! ! ");
}

$todayis = date("l, F j, Y, g:i a") ;

$attn = $attn ;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \n
Objet : $attn \n
Message : $notes \n
De : $visitor ( $visitormail )\n
Supp Info : IP = [ $ip ] \n
Navigation Info : $httpagent \n
";

$from = "From : $visitormail\r\n";


mail("Votre email ici", $subject, $message, $from);

?>

<p align="left">

------------------------------------------<br />
<b>Date :</b> <?php echo $todayis ?>
<br />
<b>Merci :</b> <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />

<b>Objet :</b> <?php echo $attn ?>
<br />
<b>Message :</b><br /> 
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
<b>Votre IP :</b> <?php echo $ip ?><br />
------------------------------------------
<br /><br />
<a href="contact.php" style="text-decoration:none;"> <b>Retour...</b> </a>
</p>

</body>
</html>
1
candudu12 Messages postés 2 Statut Membre
 
je n'ai rien compris
0
smed_79 Messages postés 1793 Statut Contributeur 844 > candudu12 Messages postés 2 Statut Membre
 
0
Utilisateur anonyme
 
Bonsoir,

si dans le formuilaire vous utilisez mailto, cela ouvre le client de messagerie de l'utilisateur (s'il en a un).
opour ubn envoi de message autre il faut utilisez mail en php.
0
Utilisateur anonyme
 
bonjour,

voir réponse N° 1,
et smed_79 a donné le code ...
0