Loading ...
Sorry, an error occurred while loading the content.

Net:smtp ?

Expand Messages
  • Gordon Stewart
    Hi, Im using NET:SMTP.. & in the SMTP.pm file it has :- ... sub mail { my $me = shift; my $addr = _addr(shift); my $opts = ; ... so, I ll ASSUME - that i
    Message 1 of 1 , Dec 2, 2001
    • 0 Attachment
      Hi, Im using NET:SMTP..
      & in the SMTP.pm file it has :-


      ----------------------------
      sub mail
      {
      my $me = shift;
      my $addr = _addr(shift);
      my $opts = "";
      ----------------------------

      so, I'll ASSUME - that i have to send the email addresses as part of 'mail'.

      However - in my CGI script below - I have

      $smtp->mail($ENV{USER});

      but when printing the value of $ENV{USER} - a feww lines above, it displays nothing.

      Ive slightly changed it from the examples given in SMTP.pm ...

      (slowly trying to get it to go, at work - If not, might just give up ;-) )

      G.

      ---------------------
      use Net::SMTP;
      print "Content-type: text/html\n\n";
      print "<HTML>\n<HEAD>\n";

      print "Hi<BR>";
      print "$ENV{USER}\n";
      $smtp = Net::SMTP->new('noadsm1.ird.govt.nz');

      $smtp->mail($ENV{USER});
      $smtp->to('gordon.stewart\@...');

      $recipient1="noadsm1.ird.govt.nz";

      $smtp->recipient($recipient1);

      $smtp->data();
      $smtp->datasend("To: gordon.stewart\@...\n");
      $smtp->datasend("\n");
      $smtp->datasend("A simple test message\n");
      $smtp->dataend();
      $smtp->quit;
      -----------
    Your message has been successfully submitted and would be delivered to recipients shortly.