Problem sending excel attachments with MIME::Lite in perl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem sending excel attachments with MIME::Lite in perl
# 1  
Old 01-23-2009
Problem sending excel attachments with MIME::Lite in perl

I am running a perl script that generates an excel doc and then emails it as an attachment. I can generate the excel file fine. I can scp it from the box and open it with no problems. When I send it over email, the file does open properly. The file in email is only 288 B, but on the server it is 2K. Please help.

I am not sure it matters, but I am running this script in the Solaris OS.

Code:
        my $emailrep = MIME::Lite->new(
                To => $EMAIL_RCPT,
                Subject => $SUBJECT,
                Type => 'multipart/mixed'
        ) || &errordie("-emailreport- Cannot create new email with MIME::Lite: $!");

        $emailrep->attach (
                Type => 'TEXT',
                Data => $mymessage
        ) || &errordie("-emailreport- Cannot create new email with MIME::Lite: $!");

        $emailrep->attach (
                Path => $OUTDIR,
                Filename => $EXCELREPORT,
                Type => 'application/vnd.ms-excel',
                Dispostion => 'attachment'
        ) || &errordie("-emailreport- Cannot create email with attachment: $!");

        $emailrep->send("sendmail");

# 2  
Old 01-29-2009
Quote:
Originally Posted by Mike_the_Man
When I send it over email, the file does open properly.
Perhaps you meant something else?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

MIME type for sending gzip file as attachment in email

Hello, I am trying to send a gzip file on email using below command but the zipped file received on email is corrupt. mailsend -smtp $smtpip -content-type 'application/x-gzip' -mime-type "application/x-gzip" -t $receiver -f $sender -sub "$subject" -M "$MSG" -attach $file file name is ... (1 Reply)
Discussion started by: tushar.modgil
1 Replies

2. Shell Programming and Scripting

Sending an Email using MIME protocol

Hi All, I just need to send an email using MIME protocol from perl script. The data of an email should be a HTML table(contains some datas). I just tried to send a normal text which is working fine whereas if i insert HTML tags i am getting errors. I just tried like below $mail_host =... (3 Replies)
Discussion started by: prasanna2166
3 Replies

3. Shell Programming and Scripting

Sending zip file as attachments in perl

Hi All, i have a code, where that script is sending mail to the users, but i want to enhance it, i.e i need to add attachment(zip file) to that, i dont want to use MIME:LITE module or any other module, with this simple code, i need to enhance. below is my code my %mail_params = (HTML ... (13 Replies)
Discussion started by: asak
13 Replies

4. Shell Programming and Scripting

MIME - HTML mail with Excel attachment - Please help!

#!/bin/ksh ( echo "MIME-Version: 1.0" echo "Content-Type: multipart/mixed; boundary=frontier" echo "--frontier" echo "Content-Type: text/html" echo "Content-Disposition: inline" echo "\n" echo "<html><body><h1>this is html formatted text</h1></body></html>" echo "--frontier" echo... (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

5. Shell Programming and Scripting

Problem with MIME::Lite / Sendmail

Hi all, i'm using the pearl package MIME::Lite zu send eMails via sendmail. I have the problem, that in the "Received From" part oft the email header occure the user and the hostname of my machine. I'd like to have a name or an email address instead of that: Received: from... (0 Replies)
Discussion started by: andi25
0 Replies

6. Shell Programming and Scripting

Sending Attachment using MIME in UNIX

Hi, I am using the below code for sending attachment in UNIX but only blank attachment is coming in email even the content is not coming. Please help!!! export CONTENT="${DIR}/${RUN_DATE}_mailbody.txt" export SUBJECT="Search Result for Pattern - ${1}" export ATTACH=${2} ( echo... (9 Replies)
Discussion started by: rajesshh
9 Replies

7. HP-UX

How to attach an excel file in a multipart (mime) mail

Hello. I need to send mails from hp-ux with 2 attachments: a text file and an excel file. So I'm composing a mime file which I will pipe to sendmail utility. This works fine if the only attachment is the text file (i use cat command to attach text content). But I have problems with the format... (3 Replies)
Discussion started by: elcampio
3 Replies

8. Shell Programming and Scripting

Sending Attachment using MIME::Lite and Net::SMTP

Hello, I'm a newbie perl scriptor and i'm trying to figure out why i can't send an email using MIME::Lite with Net::SMTP. I keep receiving the following error: SMTP MAIL command failed: 5.7.1 Helo invalid . at attach1.pl line 31 The error keeps coming from the very last line... (2 Replies)
Discussion started by: xmaverick
2 Replies

9. Shell Programming and Scripting

ambigouity on using Mime::Lite?

Hi Everyone, I have a question related to using MIME::Lite module in perl.Below i mentioned code blocks used for sending mail through MIME::Lite. $msg = MIME::Lite -> new ( From => $from, To => $to, Subject... (0 Replies)
Discussion started by: DILEEP410
0 Replies

10. UNIX for Advanced & Expert Users

Problem with multiple excel attachments using mailx

I have written the following code send multiple attachments using mailx (uuencode file1 file1; uuencode file2 file2; uuencode file3 file3;) | mailx -s MultipleAttachments -r Sysadmin abc@xyz.com The attachments are coming properly if the file1,2,3 are either pdf, text, doc. But if these files... (2 Replies)
Discussion started by: ramanam2004
2 Replies
Login or Register to Ask a Question