charbort
01-30-2003, 03:12 PM
I have the following code that doesn't work completely. It processes the form and redirects after submission but I don't recieve any emails.
Unfortunately my eyes are going nuts I've been looking at it so long. Any ideas?
Thanks in advance,
Charbort
# ORGINAL CODE TO SEND ONE EMAIL
# Send E-Mail
# &send_mail;
# END ORIGINAL CODE
# MULTIPLE MAIL SENDING FROM CHECKBOXES
if ($Form{subject1} eq "true"){ #if checkbox "subject1" is checked
$Config{subject} = "Subscribe Wildlife"; #set message subject
&send_mail; #and send the message to the subscription manager
}
if ($Form{subject2} eq "true"){ #if checkbox "subject2" is checked
$Config{subject} = "Subscribe Fishing"; #set message subject
&send_mail; #and send the message to the subscription manager
}
if ($Form{subject3} eq "true"){ #if checkbox "subject3 is checked
$Config{subject} = "Subscribe Heritage"; #set message subject
&send_mail; #and send the message to the subscription manager
}
if ($Form{subject4} eq "true"){ #if checkbox "subject4" is checked
$Config{subject} = "Subscribe Nongame"; #set message subject
&send_mail; #and send the message to the subscription manager
}
if ($Form{subject5} eq "true"){ #if checkbox "subject5" is checked
$Config{subject} = "Subscribe Urban"; #set message subject
&send_mail; #and send the message to the subscription manager
}
# END OF MULTIPLE MAIL SENDING FROM CHECKBOXES
sub send_mail {
# Localize variables used in this subroutine. #
local($print_config,$key,$sort_order,$sorted_field,$env_report);
# Open The Mail Program
open(MAIL,"|$mailprog");
print MAIL "To: $Config{'recipient'}\n";
print MAIL "From: $Config{'email'} ($Config{'realname'})\n";
# Check for Message Subject
if ($Config{'subject'}) { print MAIL "Subject: $Config{'subject'}\n\n" }
else { print MAIL "Subject: Subscription page\n\n" }
print MAIL "The following information was submitted on the Sign up for AZGFD Email page. It was submitted by\n";
print MAIL "$Config{'realname'} ($Config{'email'}) on $date\n";
print MAIL "-" x 75 . "\n\n";
if (@Print_Config) {
foreach $print_config (@Print_Config) {
if ($Config{$print_config}) {
print MAIL "$print_config: $Config{$print_config}\n\n";
}
}
}
Unfortunately my eyes are going nuts I've been looking at it so long. Any ideas?
Thanks in advance,
Charbort
# ORGINAL CODE TO SEND ONE EMAIL
# Send E-Mail
# &send_mail;
# END ORIGINAL CODE
# MULTIPLE MAIL SENDING FROM CHECKBOXES
if ($Form{subject1} eq "true"){ #if checkbox "subject1" is checked
$Config{subject} = "Subscribe Wildlife"; #set message subject
&send_mail; #and send the message to the subscription manager
}
if ($Form{subject2} eq "true"){ #if checkbox "subject2" is checked
$Config{subject} = "Subscribe Fishing"; #set message subject
&send_mail; #and send the message to the subscription manager
}
if ($Form{subject3} eq "true"){ #if checkbox "subject3 is checked
$Config{subject} = "Subscribe Heritage"; #set message subject
&send_mail; #and send the message to the subscription manager
}
if ($Form{subject4} eq "true"){ #if checkbox "subject4" is checked
$Config{subject} = "Subscribe Nongame"; #set message subject
&send_mail; #and send the message to the subscription manager
}
if ($Form{subject5} eq "true"){ #if checkbox "subject5" is checked
$Config{subject} = "Subscribe Urban"; #set message subject
&send_mail; #and send the message to the subscription manager
}
# END OF MULTIPLE MAIL SENDING FROM CHECKBOXES
sub send_mail {
# Localize variables used in this subroutine. #
local($print_config,$key,$sort_order,$sorted_field,$env_report);
# Open The Mail Program
open(MAIL,"|$mailprog");
print MAIL "To: $Config{'recipient'}\n";
print MAIL "From: $Config{'email'} ($Config{'realname'})\n";
# Check for Message Subject
if ($Config{'subject'}) { print MAIL "Subject: $Config{'subject'}\n\n" }
else { print MAIL "Subject: Subscription page\n\n" }
print MAIL "The following information was submitted on the Sign up for AZGFD Email page. It was submitted by\n";
print MAIL "$Config{'realname'} ($Config{'email'}) on $date\n";
print MAIL "-" x 75 . "\n\n";
if (@Print_Config) {
foreach $print_config (@Print_Config) {
if ($Config{$print_config}) {
print MAIL "$print_config: $Config{$print_config}\n\n";
}
}
}