On Wednesday, Jun 4, 2003, at 00:44 US/Pacific, David Cantrell wrote:
On Tuesday, June 3, 2003 20:24 -0700 "Richard E. Adams" <[EMAIL PROTECTED]> wrote:[..]
I am working through the exercises in Chapter 1 of Learning Perl, Second
Edition, O'Reilly publishers. I am using MacOS X (10.1.5), and Perl,
v.5.6.0. An excerpt from one of the author's programs shows the
following three lines:
open MAIL, "|mail YOUR_ADDRESS_HERE"; print MAIL "bad news: $someone guessed $someguess\n"; close MAIL;
To send mail, you need two components. A mail client (aka a mail user agent or MUA) and an SMTP program (aka a mail transport agent or MTA). The 'mail' program is an MUA. It passes messages to a local MTA for delivery. IIRC on OS X the MTA (sendmail) is installed, but not configured, so 'mail' successfully hands the message over to sendmail, which then neither knows what to do with it, nor knows how to warn you of the fact.
I know that Richard is working two sets of questions:
a. how do I do this specific thing from learning perl
b. how do I do email with perlMay I highly recommend
http://search.cpan.org/author/MARKOV/MailTools-1.58/as an alternative for doing the specifics of emailing from perl. Sorting out sendmail is better these days but can be more complex than merely learning perl.
I have some illustrations of email tricks in perl up at
http://www.wetware.com/drieux/pbl/Other/email/
which I did on my little OSX box.
As for the learning perl part, if he understands that the code in the book was essentially demonstrating
invoking an external command, eg: '/usr/bin/mail'
from perl,then he has the basics for doing one of the basic 'popen()' style solutions. But as we notice, the book presumes that everyone understands MTA/MTU and that by default 'sendmail' is an available service on the local host.
ciao drieux
---
