par
Orishas » 02 mars 2007, 18:13
Voilà qui est fait mais... toujours pareil, je m'arrache les cheveux depuis des jours, mais sans succès. voici mon script maintenant.
Si quelqu'un sais où est l'erreur...
Merci
<?php
$dest="
[email protected]";
$referer= getenv("HTTP_REFERER");
$ok=1;
if($ok){
$sujet= "Mail depuis mon site!";
$header="From:
[email protected]\r\n";
//$body.="Page d'origine : $referer\n";
$body.="Site d'origine :
www.monsite.net";
$body.=" \n";
$body.="\n*** Demande d'informations ***\n";
$body.=" \n";
if(count($HTTP_POST_VARS)){
while (list($key, $val) = each($HTTP_POST_VARS)){
$body.="$key : $val\n";
}
}
if(count($HTTP_GET_VARS)){
while (list($key, $val) = each($HTTP_GET_VARS)){
$body.="$key : $val\n";
}
}
$body.="*************************\n";
if(!mail("
[email protected]",$dest,$sujet,$body,$header)){
print "erreur envoi email <br>";
}
// affiche le html qui suit si succes
?>
<html>
<head>
<title>Monsite</title>
<meta http-equiv="refresh" content="5;URL=../index.html">
</head>
<body bgcolor="#FFFFCC">
<script type="text/javascript" src="codagemail.js"></script>
<h1 align="center"> </h1>
<h1 align="center"><font color="#003366">MERCI</font></h1>
<div align="center"><font color="#003366"><i><font size="4">Votre demande est
envoyée elle sera traitée dans les plus brefs délais<br>
</font></i></font><br>
<br>
<font color="#003366"><i>Veuillez patienter nous vous redirigeons...</i></font></div>
</body>
</html>
<?php
}
else{
?>
<html>
<head><title>Monsite</title></head>
<body bgcolor="#FFFFCC">
<h1 align="center"><font color="#003366">DESOLE</font></h1>
<div align="center"><font color="#003366"><i><font size="4">notre serveur est en maintenance</font></i></font><br>
<br>
<br>
<br>
Veuillez réessayer plus tard</div>
</body>
</html>
<?php
}
?>
[quote="@rthur"]Bonjour,
Il faut que tu spécifies l'expéditeur explicitement...
[php] $header="From:
[email protected]\r\n";
if(!mail("
[email protected]",$dest,$sujet,$body, $header)){ [/php][/quote]
Voilà qui est fait mais... toujours pareil, je m'arrache les cheveux depuis des jours, mais sans succès. voici mon script maintenant.
Si quelqu'un sais où est l'erreur...
Merci
<?php
$dest="
[email protected]";
$referer= getenv("HTTP_REFERER");
$ok=1;
if($ok){
$sujet= "Mail depuis mon site!";
$header="From:
[email protected]\r\n";
//$body.="Page d'origine : $referer\n";
$body.="Site d'origine : www.monsite.net";
$body.=" \n";
$body.="\n*** Demande d'informations ***\n";
$body.=" \n";
if(count($HTTP_POST_VARS)){
while (list($key, $val) = each($HTTP_POST_VARS)){
$body.="$key : $val\n";
}
}
if(count($HTTP_GET_VARS)){
while (list($key, $val) = each($HTTP_GET_VARS)){
$body.="$key : $val\n";
}
}
$body.="*************************\n";
if(!mail("
[email protected]",$dest,$sujet,$body,$header)){
print "erreur envoi email <br>";
}
// affiche le html qui suit si succes
?>
<html>
<head>
<title>Monsite</title>
<meta http-equiv="refresh" content="5;URL=../index.html">
</head>
<body bgcolor="#FFFFCC">
<script type="text/javascript" src="codagemail.js"></script>
<h1 align="center"> </h1>
<h1 align="center"><font color="#003366">MERCI</font></h1>
<div align="center"><font color="#003366"><i><font size="4">Votre demande est
envoyée elle sera traitée dans les plus brefs délais<br>
</font></i></font><br>
<br>
<font color="#003366"><i>Veuillez patienter nous vous redirigeons...</i></font></div>
</body>
</html>
<?php
}
else{
?>
<html>
<head><title>Monsite</title></head>
<body bgcolor="#FFFFCC">
<h1 align="center"><font color="#003366">DESOLE</font></h1>
<div align="center"><font color="#003366"><i><font size="4">notre serveur est en maintenance</font></i></font><br>
<br>
<br>
<br>
Veuillez réessayer plus tard</div>
</body>
</html>
<?php
}
?>