42 users online (1 members and 41 guests)  

Thread: Email Text File


  Results 1 to 2 of 2

Related

  1. Form submission to email an Excel file.    Forum: Website Scripts Forum
    Replies: 1
  2. Form submission email an excel file.    Forum: ASP Forum
    Replies: 0
  3. extracting comments from text file    Forum: PHP Forum
    Replies: 4
  4. Replies: 0
  5. Forms - email management & flat file databases    Forum: Website Scripts Forum
    Replies: 1
  1. #1
    ScottB's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2001
    Posts
    1

    Question Email Text File

    Ok, here is the deal.

    I have a CGI script that simply takes input from a form and emails me the results. I need to change the script so that it takes the input, puts it into a flat txt file and attaches that file to an e-mail to me. I have included the original code to give you an idea of whats going on. I am very new to CGI and need some help.

    TIA, Scott

    use CGI qw(:standard);

    $mailprog='/usr/sbin/sendmail';
    $recipient='vcreg@mckissock.com';
    open (MAIL,"|$mailprog -t");
    @values = split(/&/,$ENV{'QUERY_STRING'});
    print MAIL "To: $recipient\n";
    print MAIL "Subject: VC Registration/Confirmation\n\n";
    foreach $i (@values) {
    ($varname, $mydata) = split(/=/,$i);
    @values2 = split(/%20/,$varname);
    foreach $y (@values2) {
    print MAIL "$y ";
    }
    print MAIL "=";
    @values3 = split(/%20/,$mydata);
    foreach $x (@values3) {
    print MAIL " $x";
    }
    print MAIL "\n";
    }

    close(MAIL);
    print "Location:http://www.mckissock.com/onlineseminars/thank_you.htm\n\n";

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Ah, Perls not my thing. I'm a php person.

    Try - http://www.hotscripts.com

    they have loads of perl scripts there, might find one that suits your needs.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread