Gossamer Forum
Home : General : Perl Programming :

Sending emails using checkboxes to specify recip..

Quote Reply
Sending emails using checkboxes to specify recip..
I am using the following code in a cgi script...

...<form action="$script_path" method="POST">
<input type="hidden" name="action" value="selective">
<table>|;
$file = "email.db";
open(FILE, "$file") || die "I can't open $file:$!\n";
@file = <FILE>;
foreach $line (@file) {
print "<tr><td><small>$line </td><td>: <input type=\"checkbox\" name=\"$line\"></td></tr>\n";
}
print qq|
<tr><td>...


This creates a list of email addresses with checkboxes next to each address.

Now, if I want the person using the script to be able to tick the email addresses that they want to send a mass mail to, how would I do it...I cant seem to get it to work because the checkbox name field is dynamic and will vary each time.

Once the emails are selected, I want them to be able to press submit, and an email is sent to each ticked email address.

THANKYOU.



Paul Wilson. Shocked
(Dont blame me if I'm wrong!)