
perlkid
stranger
May 3, 2000, 9:47 AM
Post #2 of 2
(265 views)
|
|
Re: sending to multiple email addresses
[In reply to]
|
Can't Post
|
|
I'm sure it's possible, and I'll take a stab at the syntax. if all of the addresses are in a data base the I would try this if the data is close to this; perlkid@host.com|perlkid| cure@thesavior.com|cure| ## first field email second name $yourmail="yourmail\@host.com"; $mailprog="/usr/lib/sendmail"; open(email, "</home/html/database/email.db"); @all=<email>; close(email); foreach $line (@all) { @fields = split(/\|/, $line); $theirname = ucfirst($fields[1]); $mailprog="/usr/lib/sendmail"; $mailto = "$fields[0]"; open (MAIL, "| $mailprog -t -oi") | | die "Can't open $mailprog"; print MAIL "To: $mailto\n"; print MAIL "From: $yourmail\n"; print MAIL "Subject:Testing\n"; print MAIL "Welcome to this mailing list.\n"; } The mail code may be a little off but it's just to give you an idea. Hope that works. Make sure to close the fields in the data base with a pipe or the code won't work. perlkid
|