cheers & happy holidays!
Knudde Günther
this is my code in the cgi handler
#!/usr/bin/perl # Copyright 2004 Boutell.Com, Inc. Compatible with our earlier C progr +am. use CGI; my $sendmail = "/usr/sbin/sendmail"; my $emailConfPath = "nieuwsbrief.conf"; my $query = new CGI; my $recipient = &clean($query->param('recipient')); my $subject = &clean($query->param('subject')); my $nieuwsbriefnaam = &clean($query->param('nieuwsbriefnaam')); my $nieuwsbriefemail = &clean($query->param('nieuwsbriefemail')); if (($nieuwsbriefnaam eq "") || ($nieuwsbriefemail eq "")) { &error("Email Rejected", "Please fill out all fields provided. Back up to the " . "previous page to try again."); } if (!open(IN, "$emailConfPath")) { &error("Configuration Error", "The file $emailConfPath does not exist or cannot be " . "opened. Please read the documentation before installing " . "email.cgi."); } my $returnpage; my $ok = 0; while (1) { my $recipientc = <IN>; $recipientc =~ s/\s+$//; if ($recipientc eq "") { last; } my $returnpagec = <IN>; $returnpagec =~ s/\s+$//; if ($returnpagec eq "") { last; } if ($recipientc eq $recipient) { $ok = 1; $returnpage = $returnpagec; last; } } close(IN); if (!$ok) { &error("Email Rejected", "The requested destination address is not one of " . "the permitted email recipients. Please read the " . "documentation before installing email.cgi."); } # Open a pipe to the sendmail program open(OUT, "|$sendmail -t"); # Use the highly convenient <<EOM notation to include the message # in this script more or less as it will actually appear print OUT <<EOM To: $recipient Subject: $nieuwsbriefnaam $subject Reply-To: $email Supposedly-From: $name $nieuwsbriefnaam $subject Naam: $nieuwsbriefnaam Emailadres: $nieuwsbriefemail EOM ; close(OUT); # Now redirect to the appropriate "landing" page for this recipient. print $query->redirect($returnpage); exit 0; sub clean { # Clean up any leading and trailing whitespace # using regular expressions. my $s = shift @_; $s =~ s/^\s+//; $s =~ s/\s+$//; return $s; } sub error { # Output a valid HTML page as an error message my($title, $content) = @_; print $query->header; print <<EOM <html> <head> <title>$title</title> </head> <body> <h1 align="center">$title</h1> <p> $content </p> EOM ; exit 0; }
In reply to excel sheet as attachment by knudde
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |