Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > email script

Reply
Thread Tools

email script

 
 
Shawn
Guest
Posts: n/a
 
      07-09-2003
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;

--


 
Reply With Quote
 
 
 
 
Bob Walton
Guest
Posts: n/a
 
      07-09-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute a script from another script and other script does notdo busy wait. Rajat Python 3 01-08-2010 02:05 PM
RE: How to execute a script from another script and other script doesnotdo busy wait. VYAS ASHISH M-NTB837 Python 2 01-07-2010 08:18 PM
Mozilla Thunderbird Email NOT capturing clicked email links... AJPDLA Firefox 4 04-12-2006 07:05 PM
Email server timing out in email script John Silver Perl 0 02-04-2005 07:47 AM
HowTo:? open email client to send email Peter ASP .Net 0 07-01-2003 04:58 PM



Advertisments