This is what I get when using the $line variable and not the $file variable. I merely switched the two:
Content-Transfer-Encoding: binary Content-Type: multipart/mixed; boundary="boundary-111916012012" MIME-Version: 1.0 Date: 111916012012 From: sking@mortgage-pros.com To: admin@mortgagerefinancingpros.com Subject: New loan request in database (extra fields) This is a multi-part message in MIME format. --boundary-111916012012 Content-Disposition: inline Content-Length: 271 Content-Transfer-Encoding: binary Content-Type: text/plain Dear Member, Please find attached to this email message a loan application file from a recent loan applicant. Be sure to save this DU 3.2 file to you +r hard drive and import the data into your loan processing program. Regards, Site Administration Mortgage-pros.com --boundary-111916012012 Content-Disposition: inline; filename="1033du.txt" Content-Transfer-Encoding: base64 Content-Type: application/zip; name="1033du.txt" MTAzM3x8fFNjb3R8c2tpbmdAbW9ydGdhZ2UtcHJvcy5jb218WWVzfFl8fHx8fDF8fDM2MH +x8fHx8 fHx8fHx8fHx8fHx8fHx8fHx8fHxTY290fEN8S2luZ3x8fHx8fGFzZGZ8NTY1NDY1NDY1NH +x8fDE2 NTQxMTIzfDV8fHx8fHx8fHx8fHx8MTIzIEFueSBTdHJlZXR8fEFueSBDaXR5fENBfDEyMz +Q1fHx8 fFl8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8Z3x8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH +x8fHx8 fHx8fHNhZGZ8fHx8fHx8fHx8fDU2NDU2NTU1fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH +x8fHx8 fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH +x8fHx8 fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH +x8fHx8 fHx8fHx8fHx8fHx8fHxZfFl8fHx8fHx8fHx8fHx8fHx8fHx8fHx8YXBwfHx8U3VibWl0IE +FwcGxp Y2F0aW9ufHw= --boundary-111916012012--

In reply to Re^2: mail script with attachment by zlinkexchange
in thread mail script with attachment by zlinkexchange

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.