#this is my sub for sending the email
sub sendMail{
# application object
my $self = shift;
# get arguments
my ($to, $from, $subject, $text) = @_;
open (MAIL, "|/usr/lib/sendmail -t -oi")
or die("Can not find sendmail: $!");
print MAIL <<_MAIL_;
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
To: $to
From: $from
Cc:
Subject: $subject
$text
_MAIL_
close MAIL;
}
####
my $from = "noreply\@xxxxxx.com";
my $subject = "Membership";
my $link = "http://www.xxxxxx.com/xxxxxx/index.cgi?rm=activate&id=$activate_code&email=$email";
my $text = "$link";
$self->sendMail($email, $from, $subject, $text);
####
sub URLEncode {
my $theURL = $_[0];
$theURL =~ s/([\W])/"%" . uc(sprintf("%2.2x",ord($1)))/eg;
return $theURL;
}