Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > sending an excel attachment with MIME::Lite

Reply
Thread Tools

sending an excel attachment with MIME::Lite

 
 
p cooper
Guest
Posts: n/a
 
      01-31-2004

Ive converted a pipe-delimited file to excel format with
Spreadsheet::WriteExcel;

I now want to email it using MIME::Lite

anyone help out with
$message ->Type & encoding
( and the other stuff if its not correct)


my $message = MIME::Lite->new(
From => 'xxxxx' ,
To => 'xxx' ,
Cc =>'xx',
Subject => 'The database file as an Excel format,
Type => 'application/excel',
Encoding => '8bit',
Data => "Database files"
);

my ($mime_type, $encoding) = ('application/xls', 'base64');

$message->attach (
Type => $mime_type ,
Encoding => $encoding ,
Path => '/tmp/file.xls' ,
Filename => 'file.xls'
);

 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      01-31-2004

p cooper <(E-Mail Removed)> wrote:
> Ive converted a pipe-delimited file to excel format with
> Spreadsheet::WriteExcel;
>
> I now want to email it using MIME::Lite
>
> anyone help out with
> $message ->Type & encoding
> ( and the other stuff if its not correct)
>
>
> my $message = MIME::Lite->new(
> From => 'xxxxx' ,
> To => 'xxx' ,
> Cc =>'xx',
> Subject => 'The database file as an Excel format,
> Type => 'application/excel',


You don't want this here. Probably you don't want a type here at
all. If you do want one, you want multipart/mixed.

> my ($mime_type, $encoding) = ('application/xls', 'base64');


The list of MIME types is at
http://www.iana.org/assignments/media-types/index.html, and the
correct one for Excel is appliaction/vnd.ms-excel. The encoding should
be Base64.

Note that this is not a Perl question.

Ben

--
don't get my sympathy hanging out the 15th floor. you've changed the locks 3
times, he still comes reeling though the door, and soon he'll get to you, teach
you how to get to purest hell. you do it to yourself and that's what really
hurts is you do it to yourself just you, you and noone else * http://www.velocityreviews.com/forums/(E-Mail Removed)
 
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
Problem with Excel reports ::::Excel 2003 Migration To Excel 2007 =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= ASP .Net 15 10-24-2007 01:34 PM
sending email with attachment w/out filesystem Trapulo ASP .Net 1 04-27-2005 06:02 AM
Sending an Attachment. IAN GARDNER Computer Information 6 05-24-2004 09:58 PM
sending mail with attachment Cantekin Guneser ASP .Net 1 04-18-2004 02:53 PM
Sending more than one attachment Dragos Marian Barbu ASP .Net 0 11-10-2003 11:43 PM



Advertisments