MIME::Lite, getting a warning.

Discussion in 'Perl Misc' started by Justin C, Mar 7, 2007.

  1. Justin C

    Justin C Guest

    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.

    --
    Justin C, by the sea.
    Justin C, Mar 7, 2007
    #1
    1. Advertising

  2. Justin C

    Justin C Guest

    On 2007-03-07, Justin C <> wrote:
    >
    > 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.

    --
    Justin C, by the sea.
    Justin C, Mar 8, 2007
    #2
    1. Advertising

  3. Justin C

    Bart Lateur Guest

    Justin C wrote:

    >my $fname = glob "pa206_*xls" ;


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

    --
    Bart.
    Bart Lateur, Mar 9, 2007
    #3
  4. Justin C

    Justin C Guest

    On 2007-03-09, Bart Lateur <> wrote:
    > Justin C wrote:
    >
    >>my $fname = glob "pa206_*xls" ;

    >
    > 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.

    --
    Justin C, by the sea.
    Justin C, Mar 9, 2007
    #4
    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. John B. Kim

    MIME::Lite HTML message handling

    John B. Kim, Jan 18, 2004, in forum: Perl
    Replies:
    1
    Views:
    1,693
    Joe Smith
    Jan 19, 2004
  2. Zev Steinhardt

    Perl Mime::Lite question. Help please?

    Zev Steinhardt, Aug 24, 2004, in forum: Perl
    Replies:
    1
    Views:
    745
    dan baker
    Sep 1, 2004
  3. Aaron Brady

    SQL, lite lite lite

    Aaron Brady, Dec 29, 2008, in forum: Python
    Replies:
    15
    Views:
    739
    Aaron Brady
    Jan 1, 2009
  4. Jane Humbrey
    Replies:
    5
    Views:
    264
    Jane Humbrey
    Sep 1, 2003
  5. Anurat Chapanond

    MIME::Lite on ActivePerl

    Anurat Chapanond, Nov 5, 2003, in forum: Perl Misc
    Replies:
    5
    Views:
    668
    Bart Lateur
    Nov 6, 2003
Loading...

Share This Page