#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    kochi,kerala
    Posts
    1
    Rep Power
    0
    i would like to write a perl program which would accept my input values using a form and add attachment to the program so that when i receive my email i get it as an attachment . should i do this using MIME or any other if so please tell me the code

    ------------------
    HotNim
  2. #2
  3. No Profile Picture
    ledjon
    Guest
    Devshed Newbie (0 - 499 posts)
    Write the info that you want in the attachment into a temporary file, then attach it to the e-mail (here's a thread on attachments). Example:
    let's say your in the /home/site directory (just a random directory). Do this:

    #######
    open(FILE, "<attach.txt") &#0124; &#0124; print "$!";
    print FILE $stuff;
    close(FILE);
    #######

    $stuff is whatever you want to write to the file.

    Then when you attach the file the path to the file is "/home/site/attach.txt". Write the part of the script to e-mail it off to you, then:
    ####
    unlink('/home/site/attach.txt');
    ####
    That will delete the temporary file from the system.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 1999
    Posts
    33
    Rep Power
    16
    maybe check out the perl module Mail::Mailer

IMN logo majestic logo threadwatch logo seochat tools logo