Allora questo è il file function.php
<?php
function text_mail($to,$subject,$message,$admin_email_addre ss,$domain)
{
// Subject encoding
//$subject = mb_convert_encoding($subject, "iso-8859-1" );
// Headerangaben
$now = time();
$eol = "\r\n";
$headers .= "From: $domain" . '<' . $admin_email_address . '>' .$eol;
$headers .= "Reply-To: $domain <" . $admin_email_address . '>' .$eol;
$headers .= "Return-Path: $domain <" . $admin_email_address . '>' .$eol;
// these two to set reply address
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters
$mail_success = mail (
$to,
$subject,
$message,
$headers
);
return $mail_success;
}
function validate_email($email){
if(eregi ("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,6}$", $email)){
$feedback = TRUE;
}
else{
$feedback = FALSE;
}
return $feedback;
}
?>
Questo è uno dei moduli, email-a-friend.php
<?php
function text_mail($to,$subject,$message,$admin_email_addre ss,$domain)
{
// Subject encoding
//$subject = mb_convert_encoding($subject, "iso-8859-1" );
// Headerangaben
$now = time();
$eol = "\r\n";
$headers .= "From: $domain" . '<' . $admin_email_address . '>' .$eol;
$headers .= "Reply-To: $domain <" . $admin_email_address . '>' .$eol;
$headers .= "Return-Path: $domain <" . $admin_email_address . '>' .$eol;
// these two to set reply address
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters
$mail_success = mail (
$to,
$subject,
$message,
$headers
);
return $mail_success;
}
function validate_email($email){
if(eregi ("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,6}$", $email)){
$feedback = TRUE;
}
else{
$feedback = FALSE;
}
return $feedback;
}
?>


Rispondi quotando