I think you need to start by clarifying some terms. What do you mean by MIME and MAIL? There are no modules by those names that I know of, though there are several in those namespaces. Is your customer opposed to all of them, or just certain ones?

It's true that LWP understands the mailto: protocol, so it may be able to send a composed message for you. I'm really not sure how mailto through HTTP works, and I'd be surprised if you can count on it working with every web server. But even if it does, first you have to compose the message, and if the message is going to have attachments, you need MIME. That's what MIME is for. It encodes the file so it can pass through 7-bit SMTP, puts it in a standard wrapper, and adds headers to tell mail clients how to decode it.

In the olden days, we sent files through email without MIME, by doing things like this:

$ uuencode <me.gif | mail -s 'My Picture' friend@somewhere.com

Then the friend would cut the encoded text out of the message and pass it through uudecode to get the original file. But there was no standard, and you had to do it all manually outside your mail client. MIME developed to standardize and automate the process.

You could still do something like that today, but only if you're controlling both ends so you know how to decode your encodings. A client who wants to send attachments to anyone but says you can't use MIME, is like a client who hires you to drive nails but says you can't use a hammer. He'd better have a really good reason. Without knowing that reason, it's hard to suggest what would be an acceptable alternative.

Aaron B.
Available for small or large Perl jobs; see my home node.


In reply to Re: Sending a email with file attachment with LWP ONLY by aaron_baugher
in thread Sending a email with file attachment with LWP ONLY by MarkusH

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.