Important alert: (current site time 7/15/2013 9:08:57 PM EDT)
 

VB icon

EVS

Email
Submitted on: 2/5/2003 1:17:59 PM
By: SpyderCo  
Level: Advanced
User Rating: Unrated
Compatibility: 5.0 (all versions), 4.0 (all versions)
Views: 7290
(About the author)
 
     EVS (email verification system) takes a user's email and sends them a verification link which must be activated for their email address to be added to a logfile. Partial script to implemented into a mailing list or other scripts where you wish to be sure they are giving actual addresses.
 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
=**************************************
= for :EVS
=**************************************
Copyright Aaron Anderson, SpyderScripts.netfirms.com. You are free to use this script in any manner without leaving copyrights intact or giving credit to the author.
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
=**************************************
= Name: EVS
= Description:EVS (email verification system) takes a user's email and sends them a verification link which must be activated for their email address to be added to a logfile. Partial script to implemented into a mailing list or other scripts where you wish to be sure they are giving actual addresses.
= By: SpyderCo
=
= Assumes:User must create stored.txt and addresses.txt then give the appropriate link in the script below.
To implement this into an existing script you may need to edit a few things, probably a little more than most unexperienced programmers will know. You would need to remove the form elements and ensure all variables are accessible.
=
=This code is copyrighted and has= limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=406&lngWId=6=for details.=**************************************

#!/usr/bin/perl -w
use strict;
use CGI;
my $query = CGI->new;
my %form = %{$query->Vars};
 use CGI qw/:standard/;
 print header,
start_html('EVS'),
start_form,
"What's your email address? ",textfield('usermail'),p,
submit,
end_form,
hr;
my $chars;
my $adminmail = "admin\@test.com";
my $sendmail = "/usr/lib/sendmail";
my $site = "http://www.site.com/cgi-bin/evs.pl";
my $accountID = $query->url_param('accountID');
my $accountAD = $query->url_param('accountAD');
my $storedID = "stored.txt" ;
my $addresses = "addresses.txt";
my @chars = ( "A" .. "Z", "a" .. "z", 0 .. 9, qw(! $ % ^ & * ) );
my $ID;
;
if ($accountID && $accountAD) {
open (ADDRESSES, ">>$addresses") or die "Cannot open addresses.txt for writing";
print ADDRESSES "$accountAD\n";
close (ADDRESSES);
print "SUCCESS! Your email address has been added to the system!\n";
}
elsif ($form{'usermail'}) {
# READING OF FILE
open(STORED, "< $storedID") or die "Cannot access stored.txt for reading";
my @used = <STORED>;
chomp(@used);
do { $ID = join '', map { $chars[ rand @chars ] } 1..17; } 
while grep {$_ eq $ID} @used;
print "An email has been sent to $form{'usermail'} for verification. The link must be activated for your account to 
be listed\n";
close(STORED);
}
# WRITING TO FILE
open(STORED, ">> $storedID") or die "Cannot access stored.txt for writing";
print STORED "$ID\n";
close(STORED);
# my $dbase = "$form{'usermail'}::$ID";
# my @dbase = split /::/, "$dbase\n";
# print "@dbase\n";
my $accountID = $ID;
my $accountAD = "$form{'usermail'}";
open (MAIL, "|$sendmail -t") or die "Cannot access mail";
print MAIL "To: my $form{'usermail'}\n";
print MAIL "From: $adminmail\n";
print MAIL "Subject: Verify your Email Address\n\n";
print MAIL "$site/1.pl?accountID=$accountID&accountAD=$accountAD\n\n";
print MAIL "If the link above is not active copy and paste it in your broswer.";
close (MAIL);


Other 17 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.