- <?
- // ------------------------------------------
- // Auteur : NoKi (nokifr@aol.com)
- // Site : http://zaolien.free.fr/
- // ------------------------------------------
-
- function sendMail($nomFrom,$mailFrom,$nomTo,$mailTo,$CC,$BCC,$sujet,$body,$pj) {
- if(getenv("SERVER_NAME")!="localhost") {
- $tete = "From: ".$nomFrom." <".$mailFrom.">\n";
- // $tete = "From: ".$mailFrom."\n"; chez Nexen
- $tete .= "Reply-To: ".$mailFrom."\n";
- if(STRPOS($CC,"@")) $tete .= "Cc: ".$CC."\n";
- if($CC!="no") $temp = "truc@site.com"; // surveillance webmaster !...
- if(STRPOS($BCC,"@"))
- if($temp) $temp .= ",".$BCC;
- else $temp = $BCC;
- else if(file_exists($BCC)) { // 65 K max pour publipostage
- $fichlst = file($BCC);
- while(list($cle,$val) = each($fichlst))
- if($temp) $temp .= ",".TRIM($val);
- else $temp = TRIM($val);
- }
- if($temp) $tete .= "Bcc: ".$temp."\n";
- if(SUBSTR($body,0,6) == "<html>") $tete .= "Content-Type: text/html; charset=iso-8859-1\n"; // Type MIME
- return mail($nomTo." <".$mailTo.">",$sujet,$body,$tete);
- // include("mail.inc"); return email($mailTo,$sujet,$body,$tete); chez Nexen
- }
- else return false;
- }
- ?>
<?
// ------------------------------------------
// Auteur : NoKi (nokifr@aol.com)
// Site : http://zaolien.free.fr/
// ------------------------------------------
function sendMail($nomFrom,$mailFrom,$nomTo,$mailTo,$CC,$BCC,$sujet,$body,$pj) {
if(getenv("SERVER_NAME")!="localhost") {
$tete = "From: ".$nomFrom." <".$mailFrom.">\n";
// $tete = "From: ".$mailFrom."\n"; chez Nexen
$tete .= "Reply-To: ".$mailFrom."\n";
if(STRPOS($CC,"@")) $tete .= "Cc: ".$CC."\n";
if($CC!="no") $temp = "truc@site.com"; // surveillance webmaster !...
if(STRPOS($BCC,"@"))
if($temp) $temp .= ",".$BCC;
else $temp = $BCC;
else if(file_exists($BCC)) { // 65 K max pour publipostage
$fichlst = file($BCC);
while(list($cle,$val) = each($fichlst))
if($temp) $temp .= ",".TRIM($val);
else $temp = TRIM($val);
}
if($temp) $tete .= "Bcc: ".$temp."\n";
if(SUBSTR($body,0,6) == "<html>") $tete .= "Content-Type: text/html; charset=iso-8859-1\n"; // Type MIME
return mail($nomTo." <".$mailTo.">",$sujet,$body,$tete);
// include("mail.inc"); return email($mailTo,$sujet,$body,$tete); chez Nexen
}
else return false;
}
?>