#PWS notifier/logger # Report.pm # C. Prichard # 2-2-01 package Report; $ReportPackage = "PWS::Report"; $ReportPackage::Version = "000514"; $::Report = $ReportPackage; sub new(){ my $class = shift; bless $self{}; $self->init(); $self; } sub init(){ use Lady::Lady_DATE; $self{'TIME'} = new Lady_DATE; $LADY_TABLE{'_time'} = $self{'TIME'}->lady_time; $self{'smtp'} = "mail.somewhere.net"; $self{'admin_email'} = 'myname@mail.somewhere.net'; $self{'smtp_username'} = 'user'; $self{'header'} = " $ENV{'REMOTE_ADDR'}"; $self{'message'} = "$LADY_TABLE{'_time'}\n\nRemote ADDR:$ENV{' +REMOTE_ADDR'}\n\nRemote HOST:$ENV{'REMOTE_HOST'}\n\nHTTP_REFERER:$ENV +{'HTTP_REFERER'}\n\nUSER AGENT:$ENV{'HTTP_USER_AGENT'}\n\nBYE.\n\n-PW +S\n"; return; } sub report(){ my $class = shift; use Net::SMTP; $smtp = Net::SMTP->new( $self{'smtp'}, Hello => $self{'smtp'}, Timeout => 30, Debug => 1); # print "DOMAIN:".$smtp->domain."<br>\n"; $smtp->quit; $smtp = Net::SMTP->new($self{'smtp'}); $smtp->mail($ENV{USER}); $smtp->to($self{'admin_email'}); $smtp->data(); $smtp->datasend("To: $self{'smtp_username'}\n"); $smtp->datasend("From: PWS \n"); $smtp->datasend("Subject: PWS accessed from:$self{'header'}\n" +); $smtp->datasend("START::\n"); $smtp->datasend("\n\nHello:\n\n"); $smtp->datasend("$self{'message'}\n"); # $smtp->datasend("::END\n"); $smtp->dataend(); $smtp->quit; return; } 1;

In reply to PWS::Report by Steeeeeve

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.