If your just looking for basic e-mail subject then add the folowing line
after the datasend("To" line:
$smtp->datasend("Subject: $subject\n");
Oops - and of course don't forget to define $subject somewhere before this.
my $subject = "Perl rules!";
If your looking for more control look at some of the other mail modules to
use with Net::SMTP like Mail::Sender, Mail::Mailer, MIME::Lite, and
MIME::Entity (part of MIME-Tools bundle).
Hope this helps.
Trevor Joerges
SendMIME Software
www.sendmime.com
----- Original Message -----
From: "Leon" <[EMAIL PROTECTED]>
To: "win32" <[EMAIL PROTECTED]>
Cc: "Yahoo Beginner Perl" <[EMAIL PROTECTED]>
Sent: Friday, August 01, 2003 9:45 AM
Subject: NET:SMTP Subject Method
> Hi everyone.
>
> First thanks for everyones help with the problems I
> was having with getting net:stmp to install. The
> person who suggested I install bundle-libnet (or maybe
> it was libnet-bundle) hit the nail on the head. This
> installed the net:smtp module.
>
> I have a script that looks like this:
> #Send E-mail for Critical Alerts
>
> #Here we define our parameters
> $to = '[EMAIL PROTECTED]';
> $from = "Openview";
> $body = "Critical Alert";
>
> #Here we use the module $ pass parameters
> use Net::SMTP;
>
> $smtp = Net::SMTP->new('10.11.1.134');
>
> $smtp->mail($ENV{USER});
> $smtp->to($to);
>
> $smtp->data();
> $smtp->datasend("From: $from\n");
> $smtp->datasend("To: $to\n");
> $smtp->datasend("\n");
> $smtp->datasend("$body");
> $smtp->dataend();
>
> $smtp->quit;
>
> I copied most of it from the documentation but the
> documentation doesnt seem to specify how to create a
> subject field. Does anyone know how to do this? The
> link to the module page is right here.
>
> http://search.cpan.org/author/GBARR/libnet-1.16/Net/SMTP.pm
>
> Thx again,
>
> Leon
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs