On Thursday 07 June 2001  4:03 pm, you wrote:
> Does anybody know how to send email via a perl script on a win32 system?
>
> Thanks.

You need the Mail::Mailer module from the CPAN (see www.perl.com)

Try this, it should work. I haven't used it in a couple of months and I've 
just switched to Linux.

use Mail::Mailer;

$to_field = '[EMAIL PROTECTED]';
$from_field = '[EMAIL PROTECTED]';
$subject = 'blah...blah;'

$mailer = new Mail::Mailer 'smtp', Server => 'yourserver';
%headers =
(
        'To' => $to_field,
        'From' => $from_field,
        'Subject' => $subject
);

$mailer->open(\%headers);
print $mailer "Whatever you want to send as the body...";
$mailer->close;

Geraint.

Reply via email to