Hello everybody,
I have a form that works with a cgi-handler in perl
It emails the data that people fill in. Now I want to receive that data directly in a excel-sheet and emailed to me.
Is this possible? And how do you do it?

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.