Thank you for registering to Bolton Dragons news letter - You will receive news and interesting articles and promotions quarterly in small size e:mails. Your e:mail will not be used for anything else and will not be passed onto any other partys.
You will shortly receive a confirmation e:mail.
To unscribe to the Bolton Dragons news letter simply re-enter your e:mail and your e:mail will be taken off
Sorry, but there is already an entry for $email";
# Sorrymessage for blank email
$sorryblankmailmessage = "
Sorry, but with a blank mail I get lost in cyberspace
";
# Sorrymessage for invalid emails
$sorryoddmailmessage = "
Sorry, but \"$email\" that does not look like an email to me
";
# Sorrymessage if someone entered your own mail
$sorryownmailmessage = "
Sorry, but I don't really want to get my own newsletter!
";
# Subscribemessage, will be shown when someone subscribes.
$subscribemessage = "
Thank you for subscribing to the Bolton Dragons newsletter, a confirmation email is on its way
";
# Subscribemail, will be sent when someone subscribes.
$subscribemail = "Thank you for subscribing to the Bolton Dragons newsletter";
# Unsubscribemessage for deletion, will be followed by the email!
$unsubscribemessage = "
We deleted the email
";
# Unsubscribemessage for failed deletion, will be followed by the email!
$failedunsubscriptionmessage = "
Sorry, you cannot unsubscribe as we didn't find an entry for $email
";
if (!file_exists($filelocation)) {
$newfile = fopen($filelocation,"w+");
fclose($newfile);
}
$newfile = fopen($filelocation,"r");
$content = fread($newfile, filesize($filelocation));
fclose($newfile);
$content=stripslashes($content);
$out="";
$lines = explode("%",$content);
foreach($lines as $l){
if ($l != $email){$out .= "%".$l;}
else{$found=1;}
}
if ($action=="sign"){
if ($found==1 or $email=="" or !checkmail($email) or preg_match("/".$pattern."/",$email)){
if ($email==""){echo $sorryblankmailmessage;}
else if ($found==1){echo $sorrysignmessage;}
else if (!checkmail($email)){echo $sorryoddmailmessage;}
else if (preg_match("/".$pattern."/",$email)){echo $sorryownmailmessage;}
$disp="yes";
}
else {
$disp="no";
$newfile = fopen($filelocation,"a+");
$add = "%".$email;
fwrite($newfile, $add);
fclose($newfile);
echo $subscribemessage;
mail ($youremail,"New newsletter subscriber.",$email."\nDelete? $newsletterlocation?action=delete&email=".$email,"From: Newsletter\nReply-To: $email\n");
$submailheaders = "From: $lettername subscription form\n";
$submailheaders .= "Reply-To: $youremail\n";
mail ($email,$lettername." subscription",$subscribemail,$submailheaders);
}
}
if ($action=="delete"){
$disp="no";
if ($found == 1){
$newfile = fopen($filelocation,"w+");
fwrite($newfile, $out);
fclose($newfile);
echo $unsubscribemessage;
$disp="no";
}
if ($found != 1){
echo $failedunsubscriptionmessage;
$disp="YES";
}
}
if ($pw == $pass){
if ($send != "yes" && $send != "test"){
print'';
}
$mailheaders = "From: $lettername\n";
$mailheaders .= "Reply-To:$youremail\n";
# If you want to send HTML mail, uncomment this line!
// $mailheaders .= "Content-Type: text/html; charset=iso-8859-1\n";
if ($send == "yes"){
$message="".stripslashes($message);
$subject=stripslashes($subject);
$lines = explode("%",$content);
foreach ($lines as $l){mail ($l,$subject,$message,$mailheaders);}
print "The following email has been sent!";
print "