Hi Monks,

In one of my applictaion, we create the "tar" files.
The tar file is created using "Archive::Tar" module.

These files will be sent as attachments to the email using "MIME::Lite" module.
We are receiving the mails and the attachments.
But, when we open the attachment an error is displayed as "Error reading header after processing 0 records".

The code which I am using to send the tar file is :
my ($msg, $to_list, $cc_list, $subject, $MailFrom, $email, $file); $MailFrom = xxx@abc.com; $email = "Test data you got"; $subject = "Test mail"; $to_list = "santhi@xx.com"; $cc_list = "santhi@xx.xom"; $file = "newfile.tar"; $msg = MIME::Lite->new( From => $MailFrom, To => $to_list, Cc => $cc_list, Subject => $subject, Type => 'TEXT', Encoding => '7bit', Data => $email ); ### Attach a part... the make the message a multipart automatically: $msg->attach(Type => 'application/x-tar', Encoding => 'base64', Path => "$file" ); $msg->send() ;

Please let me know how can I resolve this error.

Thanks a lot!!
Santhi

In reply to Problem in sending "tar" files as attachment using MIME::Lite module by santhi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.