MIME::Lite, getting a warning.

J

Justin C

I have a script that mails a zip file to a user, when I run it a warning
is generated: no data in this part

Ideally I'd like to have it run 'clean', can someone give me some clues
on how to make this work without generating a warning?

CODE START
my $sender = '[edit]' ;
my $recipient = '[edit]' ;
my $subject = 'monthly .zip mailing' ;
my $messageText = "Please find attached a .zip file containing Excel files\n";
my $fname = glob "pa206_*xls" ;

# create the message
my $msg = MIME::Lite->new(
From => $sender,
To => $recipient,
Subject => $subject,
Type => 'TEXT',
Data => $messageText
) ;

# attach the zip file
$msg->attach (
Type => 'application/zip',
Path => $fname,
Filename => $fname
) ;

# send the message
$msg->send() ;

CODE END

Thank you for any help you can give with this.

Justin.
 
J

Justin C

I have a script that mails a zip file to a user, when I run it a warning
is generated: no data in this part

Abort!

I don't know what came over me there. I should have *at least* included
"use MIME::Lite" in the sample code.

Found the problem, it was a failing of a part of the script that I
didn't include... which obviously goes against the instructions of the
FAQ, to post working code that demonstrates the problem.

Sorry to have wasted anyone's time.

Thank you, Robert, for taking the time to suggest something.

Justin.
 
J

Justin C

Are you sure this matches anything? This looks like a real odd name for
a ZIP file.

It matched something, the problem was, it matched more than one
something.

Thanks for looking.

Justin.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top