[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] sending email through Perl



At 12:04 PM -0800 11/14/98, Xah Lee wrote:
>In unix, I can send email using, e.g.
>
> qx{echo "$bodyText" | mail -s subjectLine xah\@best.com};

that will only work if you are running the perl script on a unix box that
is connected to the internet at the time the script is called.  If you're
using a personal unix box, it has to connect to the internet before that
would work.

the alternate is to connect the perl script to your ISP's mail server
(probably mail.best.com) on port 25 - and send SMTP commands to the server.
I KNOW for a fact that with SMTP commands, there is a "RSET" command which
RESETS the mail from, to, subject, etc etc etc and gets ready as if you
re-established a connection.  the direct "sendmail" program I'm familar
with when used on the unix environment does NOT have a "rset" function.

>But what's a portable way of sending email in Perl?

I'd assign a hash, both with who it's to (internet email addy) and the
actual text.

:)

>If I have 100 mails to send with 100 different $bodxText, I gather
>that there's more efficient way than calling mail 100 times. What
>should I do?

I only know that if you can open up a TCP/IP connection (I'M LOOKING FOR
THAT CODE, IF YOU CAN DEVELOP OR FIND IT, I'D APPRECIATE IT) and send
commands to the SMTP server.  :)

>(sending email is covered in FAQ, but I'm not sure the answer given
>there is up to date or what I wanted...)
>
>Thanks in advance.
>
> Xah, xah@best.com
> http://www.best.com/~xah/PageTwo_dir/more.html
> "Petty penguins make way: GNU HURD is coming! <www.gnu.org>"
>
>
>***** Want to unsubscribe from this list?
>***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch

  Just my 2¢ worth.

--Tim

--------------------------------------------------------------------------------
"If the opposite of 'pro' is 'con' ...
    does that mean the opposite of 'progress' is 'congress'??"  -- Unknown
--------------------------------------------------------------------------------



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch