CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Mailing list

 



ortora
Deleted

Feb 2, 2001, 10:30 PM

Post #1 of 6 (426 views)
Mailing list Can't Post

Hi, I have a question related to mailing list management. The script I am using lets me add subscribers to the list, but one at a time. Is it possible to modify it so that it'd let me add bulk email addresses? If so, how can it be done?

The script checks the validity of the email addresses with this portion...

sub checkaddress {

$INPUT{'email'} =~ s/\s//g;

unless ($INPUT{'email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(,)/
|| $INPUT{'email'} !~
/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/)
{
$legalemail = 1;
} else {
$legalemail = 0;
}

How can I change it so that it allowes me to add several addresses at once?

Thanks.




muinatit
Deleted

Feb 4, 2001, 5:50 AM

Post #2 of 6 (417 views)
Re: Mailing list [In reply to] Can't Post

I'm just going to change up everything....


Code
$INPUT{'email'} = CheckAddress($INPUT{'email'}); 

###
sub CheckAddress {
###
my (@emails) = @_;

foreach $email (@emails) {
if ($email =~ /(\w{1}[\w-.]*)\@([\w-.]+)\.(\w{1,3}$)/) {
$email = "$1\@$2\.$3";
push (@return, $email);
}
}

return (@return);
}



ortora
Deleted

Feb 7, 2001, 5:41 AM

Post #3 of 6 (406 views)
Re: Mailing list [In reply to] Can't Post

thanks a lot. does this also allow me to remove a batch of emails? or is it just to add?



ortora
Deleted

Feb 7, 2001, 6:19 AM

Post #4 of 6 (404 views)
Re: Mailing list [In reply to] Can't Post

unfortunately it did not work. i can't get it to work.



muinatit
Deleted

Feb 7, 2001, 2:52 PM

Post #5 of 6 (397 views)
Re: Mailing list [In reply to] Can't Post

Look through the code and get rid of the things that check for the $legal_email variable.

muinatit
muinatit@hotpop.com


muinatit
Deleted

Feb 7, 2001, 2:55 PM

Post #6 of 6 (397 views)
Goofed on some of the code... [In reply to] Can't Post

I goofed up some of the code on this. After the if loop is done add this.....


Code
if ($email =~ /(\w{1}[\w-.]*)\@([\w-.]+)\.(\w{1,3}$)/) { 
# the stuff from the previous post
} else {
$email = "";
}

muinatit
muinatit@hotpop.com

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives