email script

Discussion in 'Perl Misc' started by Shawn, Jul 9, 2003.

  1. Shawn

    Shawn Guest

    Hi,

    I have been using the below script to attach text files to a email and send
    the email to whoever. But, I'd like to change the file Type to attach a
    Excel file instead of a text file. What type of changes would I need to
    make?

    Thanks,
    Shawn

    #!/usr/local/bin/perl5.6

    use lib "lib";
    use MIME::Lite;

    $msg = new MIME::Lite
    From => "$ARGV[0]",
    To => "$ARGV[1]",
    Subject => "$ARGV[2]",
    Type => 'TEXT',
    Path => "$ARGV[3]",
    Encoding => '7bit';
    attach $msg
    Type => 'TEXT',
    Path => "$ARGV[4]",
    Filename => "$ARGV[5]";
    $msg->send;

    --
    Shawn, Jul 9, 2003
    #1
    1. Advertising

  2. Shawn

    Bob Walton Guest

    Shawn wrote:

    ....
    > I have been using the below script to attach text files to a email and send
    > the email to whoever. But, I'd like to change the file Type to attach a
    > Excel file instead of a text file. What type of changes would I need to
    > make?

    ....
    > Shawn
    >
    > #!/usr/local/bin/perl5.6
    >
    > use lib "lib";
    > use MIME::Lite;
    >
    > $msg = new MIME::Lite
    > From => "$ARGV[0]",
    > To => "$ARGV[1]",
    > Subject => "$ARGV[2]",
    > Type => 'TEXT',
    > Path => "$ARGV[3]",
    > Encoding => '7bit';
    > attach $msg
    > Type => 'TEXT',
    > Path => "$ARGV[4]",
    > Filename => "$ARGV[5]";
    > $msg->send;



    Try [untested]:

    ...
    attach $msg
    Type => 'application/msexcel',
    Disposition=>'attachment',
    Path => "$ARGV[4]",
    Filename => "$ARGV[5]";
    ...

    --
    Bob Walton
    Bob Walton, Jul 9, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter
    Replies:
    0
    Views:
    3,327
    Peter
    Jul 1, 2003
  2. John Silver
    Replies:
    0
    Views:
    597
    John Silver
    Feb 4, 2005
  3. Tee

    Email ErrorPage to email

    Tee, Jun 23, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    365
  4. Rajat
    Replies:
    3
    Views:
    677
    Jorgen Grahn
    Jan 8, 2010
  5. VYAS ASHISH M-NTB837
    Replies:
    2
    Views:
    539
    Jan Kaliszewski
    Jan 7, 2010
Loading...

Share This Page