Lynn,

If you are interested in an alternative tool to send mail than postie, you 
may want to look at Mail::Sender which is what we tend to recommend to 
user's of our NT Scripts. Although if anyone has more up to date 
information on the best Mailer to use for NT, I'd be glad to hear it and 
update our documents. :)

One thing you should also be careful about is that programs that require 
command-line input to pass parameters are really quite dangerous 
potentially so we tend to shy away from them. I don't know if Postie is 
like that, but Blat definitely is. Of course, you can use the array context 
system() call as well as taintmode but it is still risky.

In addition, launching an extra process on windows (especially) is quite 
expensive and slow. So your feeling on using SMTP is good.

If you are interested in a fairly generic API to send mail from CGI 
scripts, all our newer scripts come with Extropia::Core::Mail API which 
supports drivers for blat, Mail::Sender,
NTSendmail and Sendmail natively with the exact same calling API.

We did this because the state of mail packages out there on CPAN seem a 
somewhat disjointed (especially with poor support for NT). But eventually 
should they become better we'd end up replacing our API with theirs (the hope).

The modules for doing this come with our current WebCal and WebDB 
distributions. We try quite hard to make sure they work under NT, so most 
of the stuff should be NT compatible.

The usage is quite simple

use Extropia::Core::Mail;

my $mailer = Extropia::Core::Mail->create(
                         -TYPE => 'MailSender',
                         -SMTP_ADDRESS => 'something'
                         );

$mailer->send(-FROM => $from, -TO => $to, -SUBJECT => $subj, -BODY => $body);

And that's pretty much it. I am pretty sure this will work well on NT for you.

You can download Mail::Sender using PPM on your NT Server. So type

ppm

And then

install Mail-Sender

Note that the PPM package for Mail-Sender is not available for older Perl's 
I think. But it definitely downloads fine for me on ActiveState Perl 5.6.1.

Anyway, I think Mail::Sender will be much easier for you (even if you 
decide to use it natively) than Net::SMTP.

Later,
    Gunther

At 01:15 PM 9/4/2001 -0700, Lynn Glessner wrote:
>Here is an interesting tidbit for anyone thinking of using the command line
>mail tool "postie" on Windows from their cgi script.
>
>I decided to send email through a system call to postie, just because postie
>is how I have always sent mail from the command line in Windows :) I
>couldn't figure out why I was getting a display error from IIS - it worked
>fine in a test script but not in my real script. Turns out postie was
>wanting to display a complaint about CGI, and I finally found this tidbit
>from the author of the utility:
>
>"To run Postie from a CGI program and get it to process command-line
>arguments properly you must first un-set the environment variable
>'GATEWAY_INTERFACE' or run the program without inheriting the parent CGI
>program's environment"
>
>In other words, use undef(ENV{GATEWAY_INTERFACE}); before executing your
>system command calling postie, and then all is well.
>
>Thought I would pass this on so no one else wastes time on the same thing, I
>only found one mention of it in my google web search and and none in my deja
>news search (or whateve it is called now) so it most not be a very popular
>way to go - or else people give up and do it another way.
>
>BTW, I looked at the NET:SMTP included with activeperl and didn't see how I
>could make the contents of a text file be the body of my message. If someone
>can tell me how that is possible, I would prefer to use that method in the
>future. (I'm avoiding installing any more modules than what were included.)
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

__________________________________________________
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Open Web Technology Company
http://www.eXtropia.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to