in reply to Sending a email with file attachment with LWP ONLY
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.comThen 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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sending a email with file attachment with LWP ONLY
by tobyink (Canon) on Jul 05, 2012 at 13:36 UTC | |
by aaron_baugher (Curate) on Jul 05, 2012 at 14:53 UTC |